简体   繁体   English

如何在Web服务安装期间更改默认的虚拟目录名称?

[英]How do I change the default Virtual Directory name during a web service install?

I have a C# web service, created using VS2008. 我有一个使用VS2008创建的C#Web服务。

I have a deployment project that creates the MSI I use for deployment. 我有一个部署项目,用于创建我用于部署的MSI。

Is there a setting somewhere to change the default virtual directory that the user is prompted with during the installation? 是否有某个设置可以更改安装期间提示用户的默认虚拟目录?

I'd prefer to not change the name of the webservice to do this. 我宁愿不更改Web服务的名称来执行此操作。

But isn´t this a simple case of right-clicking the setup project: 但这不是右键单击安装项目的简单情况:

select View -> File System . 选择View - > File System

From the File system explorer , click the Web Application Folder . 文件系统资源管理器中 ,单击“ Web Application Folder Press F4 to bring up the properties window (if it isn´t already visible). F4打开属性窗口(如果它不可见)。

In the properties window, scroll down to VirtualDirectory and change it to whatever you want. 在属性窗口中,向下滚动到VirtualDirectory并将其更改为您想要的任何内容。

Does that work for you? 那对你有用吗?

Visual Studio 2015.可以在Web应用程序的Web.ApplicationFolder属性上更改虚拟目录

I think I have the fix. 我想我有修复。

I couldn't find a fix thru the VS UI, so you'll need to locate your deployment project (file extention is .vdproj) and open in notepad. 我无法通过VS UI找到修复程序,因此您需要找到您的部署项目(文件扩展名为.vdproj)并在记事本中打开。

Search for "VirtualDirectory" 搜索“VirtualDirectory”

You'll find a line similar to this: 你会发现一个类似于这样的行:

"VirtualDirectory" = "8:OldName" “VirtualDirectory”=“8:OldName”

Where OldName is the current default you're seeing during installation. 其中OldName是您在安装期间看到的当前默认值。

Change "OldName" to whatever you want for a default. 将“OldName”更改为您想要的默认值。 Save and build. 保存并构建。

If there's a way to do this thru the UI, that would be even better, I couldn't find it and this works. 如果有办法通过用户界面执行此操作,那将更好,我找不到它,这是有效的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从未与虚拟目录在同一服务器上运行的WCF服务访问虚拟目录? - How do I access a virtual directory from a WCF service that is not running on the same server as the virtual directory? 如何在Application_Start期间获取Web目录? - How do I get the Web Directory during Application_Start? 如何在安装时在.NET Web服务上设置基本身份验证? - How do I set basic authentication on .NET web service on install? 如何在Web服务中获取当前目录 - How do I get the current directory in a web service 如何将应用程序标记为Web应用程序? (与虚拟目录相对。) - How do I mark an application as a web application? (As opposed to a virtual directory.) 如何更改Windows服务的名称? - How do I change the name of my Windows service? 将Web服务的输出存储在虚拟目录中 - To store the output of web service in virtual directory 如何使用C#查找Windows服务的安装目录? - How do I find the install directory of a Windows Service, using C#? 如何在安装时更改Windows服务安装目录? - How to change a Windows service installation directory at install time? 如何正确链接已安装的Web应用程序名称及其虚拟目录名称? - How to correctly link the installed web application name and its virtual directory name?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM