代码之家  ›  专栏  ›  技术社区  ›  Kcoder Bassam Alugili

当Visual Studio 2017配置为在本地IIS中运行时,如何阻止它们随机切换项目以在IIS Express中运行?

  •  1
  • Kcoder Bassam Alugili  · 技术社区  · 7 年前

    我们的团队最近升级到Visual Studio 2017。我们将服务器设置存储在项目文件中以使用本地IIS,但打开项目的属性表明它正在使用IIS Express。这似乎是随机发生的,自从我们升级后,就一直影响着随机的队友。

    IIS Express

    这个源代码管理中的csproj文件显示以下内容:

    <PropertyGroup>
      ...
      <UseIISExpress>false</UseIISExpress>
      <IISExpressSSLPort />
      <IISExpressAnonymousAuthentication />
      <IISExpressWindowsAuthentication />
      <IISExpressUseClassicPipelineMode />
      <Use64BitIISExpress />
      ...
    </PropertyGroup>
    

    以及:

    <ProjectExtensions>
      <VisualStudio>
        <FlavorProperties GUID="{...}">
          <WebProjectProperties>
            <UseIIS>True</UseIIS>
            <AutoAssignPort>True</AutoAssignPort>
            <DevelopmentServerPort>53703</DevelopmentServerPort>
            <DevelopmentServerVPath>/</DevelopmentServerVPath>
            <IISUrl>http://localhost/MyProject</IISUrl>
            <NTLMAuthentication>False</NTLMAuthentication>
            <UseCustomServer>False</UseCustomServer>
            <CustomServerUrl>
            </CustomServerUrl>
            <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
          </WebProjectProperties>
        </FlavorProperties>
      </VisualStudio>
    </ProjectExtensions>
    

    当这种情况发生时,它似乎是随机设置的 <UseIIS>True</UseIIS> False 而队友们在没有注意到这一变化时,却意外地检查到了这一变化。有没有办法阻止这种情况发生?

    2 回复  |  直到 7 年前
        1
  •  0
  •   Kcoder Bassam Alugili    7 年前

    Microsoft支持人员告诉我,这是Visual Studio 15.6中的一个已知问题:

    3月21日下午10:11,比尔·希伯特

    很抱歉延迟回复,但我们已经确定了问题所在 正在进行修复。如果 <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> 中缺少节。在中更容易发生的用户文件 15.6.

    https://developercommunity.visualstudio.com/content/problem/208768/vs-156-does-not-respect-the-apply-server-settings.html

    事实证明,一些团队成员还没有将他们的Visual Studio修补到最新版本。

        2
  •  0
  •   Tonatio    6 年前

    编辑文件 .csproj.user 并禁用IIS Express:

    <UseIISExpress>false</UseIISExpress>