Closed madjar4-cssmb closed 3 months ago
@madjar4-cssmb You are in the wrong repo (and you use an old version of the SDK, I think latest is 0.1.15-preview. The correct place is: https://github.com/microsoft/DacFx
Thanks @ErikEJ! Will move it to the right repo. (I was using 0.1.15 as well, the log is in the issue. It just hides the error from what I see)
General info
Platform: Windows Sql project created with Azure Data Studio.
Problem & context
The build fails for a realtively basic
OpenJson
example bellow. I was creating a sqlrpoj from an existing database and the exact code (short of the identifiers) inside of a much larger stored procedure was causing the build of the sqlproj to fail. I extracted that code to a new sqlproj and the same issue persists.I'm not sure if either of the desired outputs bellow are expected for the given reproduction steps. If so, I would like to know how to prevent the build error from happening with a workaround. Otherwise, I suppose this is a bug report that prevents me from using the sdk.
Steps to replicate
dbo/StoredProcedures
.dotnet build
(with or without/p:NetCoreBuild=true
).Error outputs
Applogies in advance, some of the logs are in french due to my system settings. Tested in the Azure Data Studio or with
dotnet build
. The logs are equivalent in both outputs.0.1.12-preview
Error log in 0.1.15-preview
Not sure how to update properly. I simply updated the version to in the attribute
Version
of this tag<Sdk Name="Microsoft.Build.Sql" ... />
in the sqlproj file.Note for the behavior with Visual Studio 2022 and classic sqlproj
Don't know if this will help, but before trying the package reference approach documented above, I was importing the data base with SSDT in Visual Studio 2022. Pretty much the same behavior was happening. Visual Studio was opened, got a NullReferenceException, restarted and went back to the error. A nice loop.