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:
- Create a new Console app on .NET 6 (
dotnet new console
) - Instantiate a new
TSqlModel
using the constructor that takes aSqlServerVersion
andTSqlModelOptions
. - 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:
- Created 2 years ago
- Reactions:4
- Comments:16 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jmezach sorry about the delay. I have a fix for this and planning to include it in the next release of DacFx Nuget package.
Thanks for confirming the fix. We’re planning to release by end of the year.