-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make your SQL Server Database project (.sqlproj) build with .NET Core - even on Linux or macOS! #44
Comments
Thanks for this post, it was somehow easier to find than the notes in the DacFX repository, go figure! Cheers. |
This is nice. I tested it on a linux build agent - fastest database build ever :) |
@abbgrade just target netstandard2.0 not net6.0 |
That worked. Thank you! |
Mine won't build. I am getting 201 'unresolved reference' errors. If I revert the sqlproj file back to its original state, it builds fine. I am targeting .NET framework 2.0 as instructed in the comments a month ago. Any words of wisdom? |
How are you building? Only dotnet build is currently supported reliably |
"dotnet build /p:NetCoreBuild=true" I get 951 errors this way |
Removed bin and obj folders? |
Steps to reproduce. |
I know I am missing something dumb. this happens both in VS2019 and VS2022 Sorry for two posts, I accidentally hit enter instead of shift-enter |
Did you remove the Targets ? Otherwise please share a repro project. |
I commented the tags that reference "SqlTasks.targets." there were two after the closing My apologies. I tried this on another project, and it worked flawlessly, even witht he target framework set to .NET Standard 4.5 |
Thanks for the article. I updated our .NET Framework application to use the Microsoft.Build.Sql SDK. This setup works excellent for execution in the console and there are no (build) errors. A problem occurs when I try to load the project with Visual Studio 2022. I get the message "Target framework not supported". It recommends to update the project to .NET Framework 4.8. I tried to change the |
@maxarendsen without a repro project I do not have any suggestions - you can email me privately or share here. |
@ErikEJ I created a simple repro repository. See https://github.com/maxarendsen/repro-sql-sdk-vs22. Executing the project with |
@maxarendsen That .sqlproj looks nothing like a VS .sqlproj - and does not follow the blog post format either. Create a blank .sqlproj in VS and start from that. |
@ErikEJ The updated repository works in Visual Studio and in the command line. Sorry, I was a bit sidetracked by trying to fix another problem I had with building the project. The error I got was that trying to build the project with Visual Studio gave me an error as:
This had me sidetracked by trying to update the Is this error with trying to build a known issue, and does this mean that only building with the command line |
Currently only command line build is supported, yes. Is that not mentioned in the blog post? |
@ErikEJ It states that it is possible to build with the command line, but does not say that building/publishing with Visual Studio doesn't work. Maybe a good addition? |
Hello,I have implemented you fix above. I am attempting to run this in a Docker container with Ubuntu 20.4 with MSSQL installed, all the appropriate sql tools and dot-net sdk 6.0, etc. When I attempt to build a Sql Data Project, I get this error:
I have attempted to install specifically the "4.6" dotnet SDK with this command, but I keep getting an error that it cannot resolve that version (I've also tried 4.6.2):
This is what I have on my Ubuntu Container:
So, I need to know either a) how to find the exact sdk version for 4.6 or b) how to retarget my .sqlproj file to use the version of the sdk I do have (6.0.9). I'll post my .sqlproj file in the next comment. |
.sqlproj file:
|
@pipbrandy suggest you post an issue in the DacFX repo |
It's been 2 years since initial announcement. Any idea when this technology would work for regular Visual Studio (not VS Code)? Thanks. |
@dzsquared any roadmap for the VS update? |
@pipbrandy You just needed the |
@dzsquared Any update on the VS SSDT tools to support this? and on the RTM release? |
@JinsPeter - soon! like, soon soon. so soon, in fact, that we launched a new section in the docs https://aka.ms/sqlprojects |
Well done @dzsquared and @ErikEJ! With your help I was able to build on MacOS, a great surprise to me. |
Make your SQL Server Database project (.sqlproj) build with .NET Core - even on Linux or macOS! | ErikEJ's blog
A couple of years ago I blogged about a great community project that enables you to build a .dacpac using dotnet build, even on Linux and Mac.
https://erikej.github.io/ssdt/dotnet/2022/03/07/ssdt-dacpac-netcore.html
The text was updated successfully, but these errors were encountered: