unitycontainer / configuration

Unity.Configuration package
Apache License 2.0
13 stars 13 forks source link

It does not support .netcore2.2? #17

Open 273299007 opened 5 years ago

273299007 commented 5 years ago

In order to create a new class instance by config file. I use Unity.configuration. and Unity(5.10.2).

I used the latest version of "5.10.0" in .net core 2.2 console application. It threw exception for the following code:

using (var container = new UnityContainer()) { UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity"); section.Configure(container, "Default");// threw exception in this line }

Below the exception: System.InvalidOperationException HResult=0x80131509 Message=The type name or alias **** could not be resolved.Please check your configuration file and verify this type name. Source=Unity.Configuration StackTrace: at Microsoft.Practices.Unity.Configuration.ConfigurationHelpers.TypeResolverImpl.ResolveType(String typeNameOrAlias, Boolean throwIfResolveFails) at Microsoft.Practices.Unity.Configuration.RegisterElement.ConfigureContainer(IUnityContainer container) at Microsoft.Practices.Unity.Configuration.ContainerElement.ConfigureContainer(IUnityContainer container) at Microsoft.Practices.Unity.Configuration.UnityConfigurationSection.Configure(IUnityContainer container, String configuredContainerName) The same code work fine in .net 4.6.

does it not support .netcore2.2? May I know when will release the new version which support .netcore 2.2?

thank you so much

@ENikS

jrilheu commented 4 years ago

Hi,

How about use the default DI implemented by ASP Net Core? we used and load types from the appsettings.json file.