3
votes

I'm working on an SSDT project. The publish script looks like this:

<?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <IncludeCompositeObjects>True</IncludeCompositeObjects>
        <TargetDatabaseName>VisionStaging</TargetDatabaseName>
        <DeployScriptFileName>VisionStaging.sql</DeployScriptFileName>
        <TargetConnectionString>xxxx</TargetConnectionString>
        <BlockOnPossibleDataLoss>True</BlockOnPossibleDataLoss>
        <CreateNewDatabase>True</CreateNewDatabase>
        <ProfileVersionNumber>1</ProfileVersionNumber>
        <IgnoreColumnOrder>True</IgnoreColumnOrder>
        <IgnorePartitionSchemes>True</IgnorePartitionSchemes>
      </PropertyGroup>
      <ItemGroup>
        <SqlCmdVariable Include="master">
          <Value>master</Value>
        </SqlCmdVariable>
      </ItemGroup>
    </Project>

When I open this file in Visual Studio, a few warnings appear:

The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'IncludeCompositeObjects' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'

The element 'ItemGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'SqlCmdVariable' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'.

The element 'Project' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has incomplete content.

I suppose the last one is caused by the first two. Any idea how to get rid of these warnings? Note that these files were built by the SSDT plugin which is 15.1.61902.21100 and VS does not show that any updates are available for it. In other words, the SSDT plugin put these elements in the file, not me.

1
This can be ignored, the project will build successfully without errors and you should not have any issues publishing using this publish profile.Daniel N

1 Answers

2
votes

PropertyGroup Contains a set of user-defined Property elements.

Validation of the schema in this case MSBuild schema in the Visual Studio IDE does not correctly handle custom properties, So if you have your publish.xml file open, you will always get a warning on the first custom item under PropertyGroup such as IncludeCompositeObjects

It shouldn't cause any problems, since you can define your own properties, They should only appear when you open the publish.xml file for editing in the IDE.

If you make your edits and close the file, they should go away.