question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DacFx doesn't work on .NET 6

See original GitHub issue
  • SqlPackage or DacFx Version: 150.5164.1
  • .NET Framework (Windows-only) or .NET Core: .NET 6
  • Environment (local platform and source/target platforms): macOS, Linux

Hi there, I’m the maintainer of MSBuild.Sdk.SqlProj and we’ve been working on upgrading that project to make it compatible with .NET 6. Unfortunately we’ve ran into an issue in DACFX where it seems that it is depending on Strong-name signing which seems to be no longer supported on .NET 6. We are seeing the following stack trace:

System.PlatformNotSupportedException: Strong-name signing is not supported on this platform.
     at System.Reflection.AssemblyName.get_KeyPair()
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionTypeLoader.ExtensionAssemblies.CreateAssemblyName(String partialName, AssemblyName templateName)
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionTypeLoader.ExtensionAssemblies.CreateAssemblyLoadName(String partialName, Nullable`1 specificVersion, Nullable`1 isLazy)
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionTypeLoader.ExtensionAssemblies.GetNames(HashSet`1& allNames)
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionTypeLoader.LoadTypes()
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager..ctor(String databaseSchemaProviderType)
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager.<>c__DisplayClass20_0.<SetLazyExtensionManager>b__0()
     at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
     at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
     at System.Lazy`1.CreateValue()
     at System.Lazy`1.get_Value()
     at Microsoft.Data.Tools.Schema.Extensibility.ExtensionManager.GetExtensionManager(String dsp)
     at Microsoft.Data.Tools.Schema.Sql.SchemaModel.ModelBuildingUtils.CreateEmptyModel(Type dspType, Action`1 ctorSetter)
     at Microsoft.Data.Tools.Schema.Sql.SchemaModel.ModelBuildingUtils.CreateEmptyModel(SqlPlatforms platform, Action`1 ctorSetter)
     at Microsoft.SqlServer.Dac.Model.SqlSchemaModelCreator.CreateEmptyModel(SqlServerVersion modelTargetVersion, TSqlModelOptions modelCreationOptions)
     at Microsoft.SqlServer.Dac.Model.TSqlModel..ctor(SqlServerVersion modelTargetVersion, TSqlModelOptions modelCreationOptions)

Steps to Reproduce:

  1. Create a new Console app on .NET 6 (dotnet new console)
  2. Instantiate a new TSqlModel using the constructor that takes a SqlServerVersion and TSqlModelOptions.
  3. Run the app and see the above exception

Did this occur in prior versions? If not - which version(s) did it work in? It works fine on .NET 5.

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
llalicommented, Oct 13, 2021

@jmezach sorry about the delay. I have a fix for this and planning to include it in the next release of DacFx Nuget package.

2reactions
llalicommented, Nov 9, 2021

Thanks for confirming the fix. We’re planning to release by end of the year.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DacFx and SqlPackage release notes - SQL Server
Fix diagnostic logging to a file. .NET Core (preview), Use streaming to export table data to support large tables. 18.2 SqlPackage. Release ...
Read more >
Cannot add DacFx to vs Code SQL project
I have created a new SDK-style database project in VS code and am trying to add the DacFx package as a reference to...
Read more >
Microsoft.SqlServer.DacFx 162.0.52
The Microsoft SQL Server Data-Tier Application Framework (DacFx) is a component which provides application lifecycle services for database development and ...
Read more >
Fix For Using Azure Active Directory and DacFX - bzzzt!
Only the version packaged with SSMS does not work with DacFX - you get the error above. What you have to do is...
Read more >
. NET 6 apps cannot connect to SQL. : r/dotnet
If brought to the server and run locally it connects seamlessly. I do not understand where the problem lies. The apps in dotnet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found