RadicalFx / Radical.Windows.Presentation.CastleWindsor

Radical is an infrastructure framework whose primary role is to help in the development of composite WPF applications based on the Model View ViewModel pattern.
http://www.radicalframework.com/
MIT License
0 stars 1 forks source link

WindsorApplicationBootstrapper<TView> and RavenDB can't work together #6

Closed maurodx closed 5 years ago

maurodx commented 8 years ago

I created a basic wpf app with the following packages installed

<packages>
  <package id="Castle.Core" version="3.3.3" targetFramework="net452" />
  <package id="Castle.Windsor" version="3.3.0" targetFramework="net452" />
  <package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net452" />
  <package id="Radical" version="1.5.2.1" targetFramework="net452" />
  <package id="Radical.Windows" version="1.3.16.0" targetFramework="net452" />
  <package id="Radical.Windows.Presentation" version="1.10.3.1" targetFramework="net452" />
  <package id="Radical.Windows.Presentation.CastleWindsor" version="1.4.0.0" targetFramework="net452" />
  <package id="RavenDB.Client" version="3.0.3800" targetFramework="net452" />
  <package id="RavenDB.Database" version="3.0.3800" targetFramework="net452" />
</packages>

On application startup I have this code:

bootstrapper = new WindsorApplicationBootstrapper<MainView>()
                .OnBeforeInstall(conv => 
                conv.IncludeAssemblyInContainerScan = 
                (a) => a.FullName.Contains("WpfApplication1") || a.FullName.Contains("Radical"));

And app throw exception:

Exception thrown: 'System.NullReferenceException' in System.Windows.Interactivity.dll

if I remove the call to OnBeforeInstall I got:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in WindowsBase.dll

Additional information: Impossibile caricare il file o l'assembly 'ICSharpCode.NRefactory.CSharp, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49' o una delle relative dipendenze.

Probably caused by MEF, Owin and the fact that RavenDB have merged assembly with Fody.

maurodx commented 8 years ago

Additional info: using the Radical Template from visual studio extensions the application works until I add the RavenDB.Database package. From that moment I got exception:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in WindowsBase.dll

Additional information: Impossibile caricare il file o l'assembly 'ICSharpCode.NRefactory.CSharp, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49' o una delle relative dipendenze.

mauroservienti commented 8 years ago

@maurodx interesting issue, you are not the first facing issues when using RavenDB 3 that under the hood depends on Fody, the issue is not Fody but the fact that RavenDB utilizes it screwing your dependency.

I'll have a look at it and see if there is some workaround.

mauroservienti commented 8 years ago

@maurodx I cannot repro it, it breaks if the startup code is the following:

var bootstrapper = new WindsorApplicationBootstrapper<MainView>();

But as soon as I change the code to:

var bootstrapper = new WindsorApplicationBootstrapper<MainView>()
    .OnBeforeInstall( conv =>
    {
        conv.IncludeAssemblyInContainerScan = ( a ) =>
        {
            return 
            a.FullName.Contains( "WpfApplication1" ) 
            || a.FullName.Contains( "Radical" );
        };
    } );

it works as expected since the RavenDB assemblies are not touched anymore, can you send us a repro of the failure so that I can have a look at it?

mauroservienti commented 5 years ago

Withdrawn as not reproducible