简体   繁体   English

Visual Studio-ASP网站-本地IIS-工作区名称是否可以包含在项目URL中

[英]Visual Studio - ASP Website - Local IIS - Can the workspace name be included in the project URL

A bit of background, I'm using the following tools/environment: 有点背景,我正在使用以下工具/环境:

  • Visual Studio 2012 Visual Studio 2012
  • TFS 2010 TFS 2010
  • Windows Server 2008 R2 Windows Server 2008 R2

I'm trying to get around the problem of using project URLs mapped to the local IIS for websites when using more than one workspace. 我正在尝试解决在使用多个工作空间时使用映射到网站的本地IIS的项目URL的问题。

Example: Website1 in Workspace1 is set to use the Local IIS Web Server with address: 示例:将Workspace1中的Website1设置为使用本地IIS Web服务器,其地址为:

http://localhost/Website1

If I open this website/project in Workspace2 I get an error telling me that: 如果我在Workspace2中打开此网站/项目,则会收到一条错误消息:

http://localhost/Website1 cannot be used because it already exists

Is it possible to add a reference to the workspace name (without necessarily knowing it) to the project URL, something like http://localhost/{WORKSPACE_NAME}/Website1 . 是否可以在项目URL中添加对工作区名称的引用(不一定知道),例如http://localhost/{WORKSPACE_NAME}/Website1 This means that if I open the website in Workspace1 it will be mapped to http://localhost/Workspace1/Website1 and if I open it in Workspace2 it will be mapped to http://localhost/Workspace2/Website1 . 这意味着,如果我在Workspace1中打开该网站,它将被映射到http://localhost/Workspace1/Website1 ,如果我在Workspace2中将其映射到http://localhost/Workspace2/Website1

Any ideas? 有任何想法吗?

This may not be exactly what you are looking for but... 这可能不完全是您想要的,但是...

If you uncheck "Apply server settings to all users(store in project file)" on the properties page on the "Web" tab, it will create a .user file and keep that in the workspace so that you can have different Project Urls for each workspace. 如果在“ Web”选项卡的属性页上取消选中“将服务器设置应用于所有用户(存储在项目文件中)”,它将创建一个.user文件并将其保留在工作区中,以便您可以使用不同的Project Urls每个工作区。

I tried to find a way to include the workspace name in the Project URL but no luck. 我试图找到一种方法将工作空间名称包含在Project URL中,但是没有运气。 This is slightly less magical but it works. 这有点不可思议,但有效。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM