为什么我在发布Web项目时会在web.config文件中获得ProjectGuid?

J B*_*ice 8 web-config web.config-transform visual-studio-2015

在VS2015中,我最近在我的web.config文件中添加了一条XML注释,用于我发布的网站项目:

<!--ProjectGuid: CDCD60A4-F8AC-4343-A798-8B9917B7711D-->
Run Code Online (Sandbox Code Playgroud)

这只发生在我的项目有一个有效的web.config转换文件(Web.Debug.config或Web.Release.config)时.

我试着搜索互联网,但我发现的唯一一件事是参考处理评论的存在:https://github.com/projectkudu/kudu/issues/2064.

这显然不是功能上的问题,但由于我们有多个开发人员在不同的时间将这个项目发布到我们的版本控制系统,并且只有我的系统似乎添加了这一行,它会引起很多提交噪音.

小智 10

在文件Properties\PublishProfiles\Release.pubxml中添加 <IgnoreProjectGuid>True</IgnoreProjectGuid>

例:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>True</ExcludeApp_Data>
    <publishUrl>C:\inetpub\wwwroot\</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <IgnoreProjectGuid>True</IgnoreProjectGuid>
  </PropertyGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)