Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 694
J Bryan Price Avatar asked Sep 27 '16 18:09

J Bryan Price


People also ask

What are publish profiles?

Publish profiles can simplify the publishing process, and any number of profiles can exist. Create a publish profile in Visual Studio by choosing one of the following paths: Right-click the project in Solution Explorer and select Publish. Select Publish {PROJECT NAME} from the Build menu.

How do I create a Pubxml file?

In order to create a new profile once you have already defined one, you have to open the "Publish" window (righ click on the project), click on the "Profile" tab and select the <New...> option from the drop-down list; this will create a new pubxml file (see screenshot).

Where is the Pubxml file?

pubxml and are located in the PublishProfiles folder. The PublishProfiles folder is under Properties in a C# web application project, under My Project in a VB web application project, or under App_Data in a web site project.

Where are Visual Studio publish profiles stored?

When you publish an ASP.NET Core project from Visual Studio the following happens: A publish profile is created at Properties\PublishProfiles\profilename. pubxml . The publish profile is an MSBuild file.


1 Answers

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>
like image 129
Gregory Avatar answered Sep 27 '22 19:09

Gregory