Dynamically setting the IISUrl of a Web Application Project

后端 未结 3 1160
日久生厌
日久生厌 2021-02-07 13:13

I have a web application project that I\'d like to be able to branch and develop on a totally separate IIS site and not have to keep editing the vbproj IISUrl setting each time

相关标签:
3条回答
  • 2021-02-07 13:16

    This article on programmatically changing a project file may be of some use to you in creating a solution to automate the changing of those settings: Programmatically change Web project settings from dynamic port to static

    0 讨论(0)
  • 2021-02-07 13:21

    I've been plagued by the same problem for several years now. The problem persists all the way from Visual Studio .NET (2003) up until now (VS 2010). I have searched for an automated solution for automatic URL renaming but without any success.

    What I've been doing to avoid this problem is branching way more and having lots of different workspaces:

    Root branch for ongoing project -> Branch for dev-team -> Branch for support and long-term code integrity (this is the most commonly used branch by me) -> My personal custom branches that have different URLs set

    I know it's not the best solution but this is the best one that I could figure out.

    0 讨论(0)
  • 2021-02-07 13:39

    I believe I might have a workaround for this in VS2010.

    Right click on the project in VS2010 and go to Properties. In the Web tab, Uncheck the "Apply server settings to all users (store in project file)". What this does is forces all of the settings to be stored in a [Web Project Name].csproj.user file instead of in the project file itself. (Mine is a C# project instead of VB, but I assume it works the same) This allows you to have different server settings on each machine doing development, but at the same time share the rest of the configuration.

    I had to do this because I'm using SSL certificates on each development machine (workstation and laptop) so the Project URL is different, but I don't want to have to manually mess with the URL on each machine more than once and worry about it while checking my code into source control.

    Once you've done the initial configuration on a machine after getting the latest source, your .user file holds the configuration. So long as you're not checking .user files into source control this seems to work fine.

    0 讨论(0)
提交回复
热议问题