Skip to content
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

Microsoft.Build.Sql 0.2.4-preview throws error in VS 17.12 and MSBuild, works in dotnet build #518

Open
czb182 opened this issue Nov 6, 2024 · 14 comments · May be fixed by #524
Open

Microsoft.Build.Sql 0.2.4-preview throws error in VS 17.12 and MSBuild, works in dotnet build #518

czb182 opened this issue Nov 6, 2024 · 14 comments · May be fixed by #524
Assignees
Labels
area: build sdk Related to Microsoft.Build.Sql SDK area: ssdt Related to the use of DacFx in Visual Studio (SSDT) bug Something isn't working

Comments

@czb182
Copy link

czb182 commented Nov 6, 2024

VS2022 17.11.5

Microsoft.Build.SQL 0.2.4-preview

Can not load Database project, as this error is thrown.

error : The result "" of evaluating the value "$(MicrosoftNETBuildTasksAssembly)" of the "AssemblyFile" attribute in element is not valid. C:\Users\username.nuget\packages\microsoft.build.sql\0.2.4-preview\Sdk\Sdk.targets

This is not happening with 0.2.3-preview

@czb182 czb182 added the bug Something isn't working label Nov 6, 2024
@zijchen
Copy link
Member

zijchen commented Nov 6, 2024

What happens if you use dotnet build to build the project? Trying to see if this is a VS issue or otherwise

@akdanz
Copy link

akdanz commented Nov 7, 2024

This error only pops up in VS2022 (v17.11.5) for me, no issues with dotnet build.

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 7, 2024

@akdanz You need to use .sqlprojx (SDK style SSDT) in VS 17.12 preview for proper MsBuild.Sdk.Sqlproj support. Pure luck if it works with VS 17.11

@akdanz
Copy link

akdanz commented Nov 7, 2024

@ErikEJ no problem - just wanted to confirm that this error comes from VS.

Besides that, I got it working with 0.2.3-preview and \obj\project.assets.json prebuild-deletion workaround from #490

@avivanoff
Copy link

avivanoff commented Nov 13, 2024

@ErikEJ, what do you mean by "pure luck"? It worked for us for a long time with different versions 17.x of Visual Studio and MSBuild all the way to version 0.2.3-preview. It only broke with 0.2.4-preview.

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 13, 2024

@avivanoff it was never supported.. it is in 17.12 now

@czb182
Copy link
Author

czb182 commented Nov 13, 2024

I just installed the VS 17.12 final release. When i installed the SQL sdk project preview it did not let me open up existing .sqlproj database project(The application which this project type is based on was not found. Please try this link for further information: 00d1a9c2-b5f0-4af3-8072-f6c62b433612). I would have assumed it would support .sqlproj for old format and support sdk style in .sqlprojx

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 13, 2024

@czb182 It is either or at the moment, sadly!

@avivanoff
Copy link

@avivanoff it was never supported.. it is in 17.12 now

@ErikEJ, I am completely confused now. What was not supported? Using Microsoft.Build.Sql SDK with Visual Studio and MSBuild builds?

All I know is that after upgrading to 17.12 I cannot use some of our non-SDK-style SQL projects like @czb182 reported, and I cannot update SDK-style SQL projects to 0.2.4-preview.

Are you going to fix/support building Microsoft.Build.Sql SDK projects with Visual Studio and MSBuild?

@avivanoff
Copy link

avivanoff commented Nov 13, 2024

I just installed the VS 17.12 final release. When i installed the SQL sdk project preview it did not let me open up existing .sqlproj database project(The application which this project type is based on was not found. Please try this link for further information: 00d1a9c2-b5f0-4af3-8072-f6c62b433612). I would have assumed it would support .sqlproj for old format and support sdk style in .sqlprojx

@czb182, make sure you do not have "SQL Server Data Tools" and "SQL Server Data Tools SDK-Style (Preview)" installed at the same time, see https://developercommunity.visualstudio.com/t/Trying-to-load-SSDT-projects-is-failing/10772324#T-ND10789149.

@czb182
Copy link
Author

czb182 commented Nov 13, 2024

Yeah, i just uninstalled preview. I feel like this could have been handled in a better way.

I hope DacFx/Visual Studio team can dedicate some resources and wrap this whole feature up quickly. It has been inching along for so long now. I can't tell if there is some huge amount of complexity to this or it just not been prioritized compared to other features.

I don't even need a automatic migration from old project format.. Just give support to recognize either or or new format in sqlproj and support appropriately.

@dzsquared
Copy link
Contributor

@cbz182 there's a lot of discussion on this thread already - is the recap that the 0.2.4-preview of the SDK isn't working with VS 2022 17.12, only 0.2.3-preview?

@dzsquared dzsquared added area: build sdk Related to Microsoft.Build.Sql SDK area: ssdt Related to the use of DacFx in Visual Studio (SSDT) labels Nov 14, 2024
@avivanoff
Copy link

I think it is more of "0.2.4-preview of the SDK isn't working with any version of Visual Studio or MSBuild, only dotnet builds".

@dzsquared dzsquared changed the title Microsoft.Build.Sql 0.2.4-preview "The result "" of evaluating the value "$(MicrosoftNETBuildTasksAssembly)" of the "AssemblyFile" attribute in element <UsingTask> is not valid" Microsoft.Build.Sql 0.2.4-preview throws error in VS 17.12 and MSBuild, works in dotnet build Nov 14, 2024
@dzsquared
Copy link
Contributor

thanks - I've updated the title and we're digging into the issue.

as to @czb182's concern that we keep this moving and go as quick as possible with SDK-style projects in VS - there's a lot of complexity to SQL projects (schema compare, object explorer integration) and an additional layer of other VS components with dependencies into SSDT that we're navigating. We're pressing forward with support in VS.

@zijchen zijchen linked a pull request Nov 14, 2024 that will close this issue
@zijchen zijchen self-assigned this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build sdk Related to Microsoft.Build.Sql SDK area: ssdt Related to the use of DacFx in Visual Studio (SSDT) bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants