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

CREATE ASSEMPLY script leads to "SQL70557: This assembly is corrupt or not valid" on dotnet build #523

Open
lausitzer opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lausitzer
Copy link

  • SqlPackage or DacFx Version: 162.4.92.3
  • .NET Framework (Windows-only) or .NET Core: .NET 8.0
  • Environment (local platform and source/target platforms): SQL sdk project (sdk version 0.2.4-preview) /tp:Sql150 on Windows 11

Steps to Reproduce:

  1. Create new SQL project for SQL-Server 2019: dotnet new sqlproj -tp Sql150
  2. Write SQL-Script for CREATE ASSEMBLY containing your assembly as binary literal, e.g.: CREATE ASSEMBLY [TestCLR] AUTHORIZATION [dbo] FROM 0x4D5A90000300000...
  3. Run: dotnet build

Build fails with "Build error SQL70557: This assembly is corrupt or not valid" pointing to your CREATE ASSEMBLY script.
For a cross check, executed CREATE ASSEMBLY script with SSME. Assembly gets imported flawless if appropriate conditions are met (CLR-support enabled, login for assemblies signing key created).

Also tried copying dll to $(IntermediateOutputPath) and $(OutputPath) and using assemblies name instead off binary literal. Leads to SQL70502: The assembly source is not valid. Only binary literals are allowed .

Did not test on prior versions of SDK.

Find sample-project attached. MySqlProj.zip

(DacFx/SqlPackage/SSMS/Azure Data Studio)

@lausitzer lausitzer added the bug Something isn't working label Nov 14, 2024
@lausitzer
Copy link
Author

Maybe related: microsoft/azuredatastudio#21370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant