Open alexirion10 opened 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
sqlproj targets are not supported in the .NET SDK which is used when targeting .net core. This may work if you retarget your application to net framework as that should use the net framework version of MSBuild.
And to your other questions, there are not plans for SDK support for sqlproj files in the short term.
.NET 5 released 6 months back and .NET 6 is going to release in 6 months, but no support of SQLPROJ?
+1 I'd also like to know if sqlproj would be handled by dotnet, as it is now I need to have my sqlprojects separated from the rest of the code base as I cannot run "dotnet test" for example without doing some magic
Bump
bump
bump
Our SSDT project belongs in our solution. "dotnet build" should not fail when coming across an SSDT project, it should just ignore it.
If you just want the projects to be ignored by MSBuild of .NET SDK, then perhaps you can add Condition='"$(MSBuildRuntimeType)" != "Core"'
to the Import
elements… except then you'd also have to define the Test
etc. targets yourself. I wonder if there is a way to reuse Microsoft.Build.NoTargets for that. The Sdk
element does not allow a Condition
attribute, but if you instead used <Import Project="Sdk.props" Sdk="Microsoft.Build.NoTargets" Condition='"$(MSBuildRuntimeType)" == "Core"' />
at the top and a similar element with "Sdk.targets"
at the bottom, then that might work.
Microsoft is doing good work but now a days mostly half baked stuff. Not only this issue, other areas as well similar pattern. Ex: publish single EXE (Dotnet team claiming that they are supporting but not WPF projects)
Microsoft is promoting .NET 5 (now .NET 6) as upgrade path from .NET framework 4.8/.NET core 3.1. When comes to SqlProj projects, you decided that not to support in .NET 5/6/7 near future. But what is the alternative? Please don't say use full framework. We can't use half projects .NET framework and half projects .NET5/6/7.
WE NEED Microsoft.Net.Sdk.Sql
It's interesting to understand .sqlproj destiny. If this kind of project will not have support in .NetCore, I guess it's time to replace it with some other approach (but what?). EF migrations is not always an alternative to .sqlproj (especially when we don't use EF as ORM). Now I'm using MSBuild.Sdk.SqlProj to build .sqlproj with dotnet sdk, but I'm also not sure about future of this project.
@marcpopMSFT while sqlclr alive, sqlproj should alive too, you ms guys shouldn't give up on it.
Including @baronfel for visibility on this ask.
A preview has been released https://github.com/microsoft/DacFx/tree/main/src/Microsoft.Build.Sql
<Sdk Name="Microsoft.Build.Sql" Version="0.1.3-preview" />
Nice to have some progress
Similar to https://github.com/dotnet/sdk/issues/10441 & https://github.com/dotnet/sdk/issues/8546
All
.sqlproj
files are msbuild project type ie:<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
As opposed to the new style SDK ie:
<Project Sdk="Microsoft.NET.Sdk">
--> A dotnet core 3.x, C# code application, is not able to build a sqlproj msbuild project. Example:
--> Results in:
Microsoft.Build.Exceptions.InvalidProjectFileException: 'The imported project "C:\Program Files\dotnet\sdk\2.1.522\Microsoft\VisualStudio\v15.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk
Can I otherwise instruct a dotnet application to use msbuild located elsewhere? Will SQL Server Database projects become an SDK type project? Or will dotnet be able to build non-SDK type projects?