DacFx: DacFx doesn't work on .NET 6
- 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)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 16 (6 by maintainers)
@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.
@dzsquared I’m wondering if anyone has mentioned this to you yet? My understanding is the final release of .NET 6 is about a month or so away, and I’m assuming having DacFx not working with that at release would be undesirable 🙂
this is fixed in stable release https://www.nuget.org/packages/Microsoft.SqlServer.DacFx/160.5400.1
I can confirm the same.
Do have an estimate when DACFX 160 is going to ship?
The preview version resolved the issue for me. Thank you.