application|web| Solution | problem (i) description
WebApplication installation path cannot be selected when the deployment is installed; Solution idea:
(1) Create a console application CreateWebDir.exe to create a Web virtual directory.
(2) Installation of the deployment of the production of Windows Application installation deployment, not WebApplication installation
Deployment. Because the Windows Application installation deployment has a selection path operation, the path selected
Save in [TARGETDIR].
(3) in the installation of deployment-"Custom Action" [Submit] under the Add custom action, select CreateWebDir.exe, its properties:
(A) Arguments = Bug2000 [TARGETDIR], that is, CreateWebDir.exe incoming two
Parameters. Bug2000 refers to the Web virtual directory; [TARGETDIR] refers to the physical directory.
(B) InstallerClass = False, set to non-ProjectInstaller class
(ii) Create a console application CreateWebDir.exe
(1) Main.cs
(2) CreateWebDir.cs See "IIS control Management--web virtual directory creation and management"
(3) INIFile.cs See "INI file operation (asp.net+c#)"
(iii) Main.cs documents
Using System;
Using System.IO;
Using System.DirectoryServices;
Using System.Runtime.InteropServices;
Namespace Createwebdir
{
<summary>
Summary description of the CLASS1.
</summary>
Class Start
{
<summary>
The main entry point for the application.
Parameter args:
ARGS[0]: Virtual path
ARGS[1]: Physical path
ARGS[2]: Server name, can not enter, default localhost
///
To run the example:
CreateWebDir.exe virdirtest D:\work
CreateWebDir.exe virdirtest D:\work Deve-server
</summary>
[STAThread]
static void Main (string[] args)
{
int i;
String IniFile;
if (args. Length > 1)
{
IniFile = args[1];
if (inifile.substring (inifile.length-1,1) = = "\")
IniFile = args[1]+ "Bug2004.ini";
Else
IniFile = args[1]+ "\\Bug2004.ini";
}
Else
IniFile = @ "C:\Bug2004.ini";
String iniFile = @ "D:\Bug2000.ini";
if (! File.exists (IniFile))
{
using (FileStream fs = File.create (IniFile))
{
Fs. Close ();
}
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.