我正在研究一个SSDT项目。发布脚本如下所示:
<?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>
当我在Visual Studio中打开此文件时,会出现一些警告:
命名空间'http://schemas.microsoft.com/developer/msbuild/2003'中的元素'PropertyGroup'在命名空间'http://schemas.microsoft.com/developer/msbuild/2003'中具有无效的子元素'IncludeCompositeObjects'
命名空间'http://schemas.microsoft.com/developer/msbuild/2003'中的元素'ItemGroup'在命名空间'http://schemas.microsoft.com/developer/msbuild/2003'中具有无效的子元素'SqlCmdVariable'。
命名空间'http://schemas.microsoft.com/developer/msbuild/2003'中的元素'Project'具有不完整的内容。
我想最后一个是由前两个引起的。知道如何摆脱这些警告吗?请注意,这些文件是由SSDT插件构建的,即15.1.61902.21100,VS并未显示任何可用的更新。换句话说,SSDT插件将这些元素放在文件中,而不是我。
PropertyGroup包含一组用户定义的Property元素。
在这种情况下验证模式Visual Studio IDE中的MSBuild模式无法正确处理自定义属性,因此,如果打开publish.xml
文件,您将始终在PropertyGroup
下的第一个自定义项目上收到警告,例如IncludeCompositeObjects
它不应该导致任何问题,因为您可以定义自己的属性,它们只应在您打开publish.xml
文件以在IDE中进行编辑时显示。
如果您进行编辑并关闭文件,它们应该消失。