Why am I getting a ProjectGuid in my web.config file when publishing a web project?
Asked Answered
B

1

10

In VS2015, I've recently been getting an XML comment added to my web.config file for website projects that I publish:

<!--ProjectGuid: CDCD60A4-F8AC-4343-A798-8B9917B7711D-->

This only happens when my project has a web.config transform file in effect (Web.Debug.config or a Web.Release.config).

I tried scouring the interweb but the only thing I found was in reference to dealing with the presence of the comment: https://github.com/projectkudu/kudu/issues/2064.

It's obviously not functionally an issue, but since we have multiple developers publishing this project at different times to our version control system, and only my system seems to be adding this line, it's going to cause a lot of commit noise.

Blackberry answered 27/9, 2016 at 18:43 Comment(2)
After updating to VS 2015 Update 3 today I started getting this. Did you ever find a solution? (Tabs are also being converted to spaces in the web.config, which wasn't an issue before the upgrade.)Housefather
I still haven't found a solution or an answer. I have found that my coworkers' builds are also creating this as well now, so my specific concerns over version control noise are abated for the time being.Blackberry
A
12

In file Properties\PublishProfiles\Release.pubxml add <IgnoreProjectGuid>True</IgnoreProjectGuid>

Example:

<?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>
Akel answered 13/3, 2017 at 22:37 Comment(3)
Thank you! Out of curiosity, how did you figure that out? I see it now at github.com/aspnet/vsweb-publish/blob/master/publish-module.psm1 but I'd have never thought to read all the publish module code. Is there a public doc somewhere?Blackberry
I'd also be curious if there's an option to stop having it convert tabs to spaces in that config as well.Housefather
A public doc appears to be here: go.microsoft.com/fwlink/?LinkID=208121 (at least according to a comment that was posted as answer) @JBryanPriceWondering

© 2022 - 2024 — McMap. All rights reserved.