MSBuild.Sdk.SqlProj: ARM support is broken with Microsoft.SqlTools.ManagedBatchParser
I’m trying to upgrade from the old .NET Framework SQL Projects to your .NET Standard 2.1 SQL Projects. (Thanks for creating this!!!) However, I get the following error:
SQL80001: Incorrect syntax near ‘:’.
I read in other closed issues that I need to add a Remove entry for the PostDeploy.sql script to the proj file, however it seems like these issues were from before the Post-Deployment folder was introduced, which omits all of its scripts from the build by default. How do I correct this?
Here are the relevant parts of my project file:
<Project Sdk="MSBuild.Sdk.SqlProj/3.1.1">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<SqlServerVersion>Sql150</SqlServerVersion>
<RunSqlCodeAnalysis>True</RunSqlCodeAnalysis>
<SuppressTSqlWarnings>SRD0047,SRN0007</SuppressTSqlWarnings>
<TreatTSqlWarningsAsErrors>True</TreatTSqlWarningsAsErrors>
<RunScriptsFromReferences>True</RunScriptsFromReferences>
</PropertyGroup>
<ItemGroup>
<!--<Content Remove="Pre-Deployment\**\**\*.sql" />
<Content Remove="Pre-Deployment\PreDeploy.sql" />-->
<PreDeploy Include="Pre-Deployment\PreDeploy.sql" />
<!--<Content Remove="Post-Deployment\**\**\*.sql" />
<Content Remove="Pre-Deployment\PostDeploy.sql" />-->
<PostDeploy Include="Post-Deployment\PostDeploy.sql" />
</ItemGroup>
</Project>
PostDeploy.sql: (I also tried with putting the sql script path in double quotes, but then I get another build error: SQL80001: ‘“.\Post-Deployment\dbo\StaticData\AppSetting.sql”’ is not a recognized option.)
:r .\Post-Deployment\dbo\StaticData\AppSetting.sql
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (5 by maintainers)
I can confirm that everything builds and there are no ManagedBatchParser errors in 3.1.2. Thanks.
Yes, the dll exists at that location:
Version 3.1.1 with .NET 9.0.200 (not preview) gives the same error:
That is probably because you use a preview SDK. Use a global.json file to stay on a released SDK.version