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

Using xml-config file for dynamic loading of plugin dll doesn't work in Net6 #647

Closed
AndreyPolovodov opened this issue Apr 4, 2023 · 1 comment

Comments

@AndreyPolovodov
Copy link

AndreyPolovodov commented Apr 4, 2023

I have been using Windsor container with config via new WindsorContainer("path_to_config") for a while in NetFramework till we've decided migrate to Net6. And in Net6 it doesn't work anymore. I can load class from dll only if that dll is referenced from my program.
If I remove reference - I get error

Exception: Castle.MicroKernel.SubSystems.Conversion.ConverterException: Could not convert string 'ClassLibrary.TestClass, ClassLibrary' to a type. Assembly was not found. Make sure it was deployed and the name was not mistyped.
at Castle.MicroKernel.SubSystems.Conversion.TypeNameConverter.GetType(String name)
at Castle.MicroKernel.SubSystems.Conversion.TypeNameConverter.PerformConversion(String value, Type targetType)
at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion(String value, Type targetType)
at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion[TTarget](String value)
at Castle.Windsor.Installer.DefaultComponentInstaller.GetType(IConversionManager converter, String typeName)
at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter)
at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)
at Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers, DefaultComponentInstaller scope)
at Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers)

That is a client code:

    try
    {
        var container = new WindsorContainer();
        container.Install(Configuration.FromXmlFile("config.xml"));
        var driver = container.Resolve<IDriver>();
        driver.Start();
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Exception: {ex}!");    
    }

That is a config.xml file:

<components>

    <component id="ViaQuatroIntegrationDriver" service="CommonClassLibrary.IDriver, CommonClassLibrary" type="ClassLibrary.TestClass, ClassLibrary">
      <parameters>
      </parameters>
    </component>
    
</components>

If I add reference to ClassLibrary.dll - all works as expected.
I'm using Castle.Windsor 5.1.2 from nuget

I've tried to examine source code and didn't find any tries to load dll from config dinamically.

So, is that a changed behavior? Or, may be, I missed some special option/property/whatever? Is it still possible to load dll dynamically via config file, without reference to dll?

@AndreyPolovodov
Copy link
Author

Ok, if I understand all correctly from #619 #622 and other requests about FEATURE_ASSEMBLIES that trouble should be fixed in 6.0.0 version

@AndreyPolovodov AndreyPolovodov closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant