dotnet/msbuild

Missing PublishDir from Microsoft.Build.CommonTypes.xsd

Open

#5.954 geöffnet am 10. Dez. 2020

Auf GitHub ansehen
 (6 Kommentare) (9 Reaktionen) (0 zugewiesene Personen)C# (1.364 Forks)batch import
Partner requestbughelp wantedtriaged

Repository-Metriken

Stars
 (5.062 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 7h) (125 gemergte PRs in 30 T)

Beschreibung

When you publish an app through VS (at least in some paths), it writes a FolderProfile.pubxml. I guess it is imported into the build. If you open that to look at it or edit it you will get a warning in VS

Severity	Code	Description	Project	File	Line	Suppression State
Warning		The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'PublishDir' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property, VisualStudioVersion, MinimumVisualStudioVersion, ........ etc etc, ....	ConsoleApp9	C:\Users\danmose\source\repos\ConsoleApp9\ConsoleApp9\Properties\PublishProfiles\FolderProfile.pubxml	9	

Here is an example of a FolderProfile.pubxml:

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>

  </PropertyGroup>
</Project>

I am not sure whether there are other properties it might include, but we should add PublishDir and PublishProtocol to Microsoft.Build.CommonTypes.xsd so they don't cause this disconcerting warning which will discourage anyone looking at the file.

Contributor Guide