2013-08-19 14 views
5

stavo lavorando su un progetto WPF utilizzando questi pacchetti:Metodo non trovato: 'Vuoto Caliburn.Micro.Bootstrapper`1..ctor (booleano)'

<package id="Autofac" version="3.0.2" targetFramework="net40" /> 
<package id="Caliburn.Micro" version="1.5.1" targetFramework="net40" /> 
<package id="Caliburn.Micro.Autofac" version="1.5.0" targetFramework="net40" /> 

Fino a ieri che aggiorno i pacchetti a:

<package id="Autofac" version="3.1.1" targetFramework="net40" /> 
<package id="Caliburn.Micro" version="1.5.2" targetFramework="net40" /> 
<package id="Caliburn.Micro.Autofac" version="1.5.0" targetFramework="net40" /> 

Cioè, aggiorno Autofac da 3.0.2 a 3.1.1 e Caliburn.Micro da 1.5.1 a 1.5.2 (utilizzando Nuget Package Manager). Dopo, non posso eseguire il progetto. Ottengo questo errore:

'The invocation of the constructor on type 'MyAppBootstrapper' that matches the specified binding constraints threw an exception.' Line number '9' and line position '22'.

a questa linea in App.xaml:

Il messaggio di eccezione interna è:

{"Method not found: 'Void Caliburn.Micro.Bootstrapper`1..ctor(Boolean)'."}

C'è qualche punto di aggiornare l'ho fatto che ho perso?

La completa analisi dello stack:

at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) 
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) 
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) 
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 
at Shivar.Tameshk.Server.UI.App.InitializeComponent() in d:\Projects\Shivar.Tameshk\Tameshk\Server\Shivar.Tameshk.Server.UI\App.xaml:line 1 
at Shivar.Tameshk.Server.UI.App.Main() in d:\Projects\Shivar.Tameshk\Tameshk\Server\Shivar.Tameshk.Server.UI\obj\Debug\App.g.cs:line 0 
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) 
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Threading.ThreadHelper.ThreadStart() 

e stack del eccezione interna:

at Caliburn.Micro.Autofac.AutofacBootstrapper`1..ctor() 
at Shivar.Tameshk.Server.UI.ServerUiBootstrapper..ctor() in d:\Projects\Shivar.Tameshk\Tameshk\Server\Shivar.Tameshk.Server.UI\ServerUiBootstrapper.cs:line 28 

risposta

9

Beh, ho trovato la risposta :) Il problema è qui:

Il Caliburn.Micro.Autofac.AutofacBootstrapper<TRootViewModel> in Caliburn.Micro.Autofac pacchetto nuget (versione = "1.5.0") estende Caliburn.Micro.Bootstrapper<TRootModel> in Caliburn.Micro pacchetto, e ha un costruttore simili:

public AutofacBootstrapper() : base(true) { } 

Significa chiama il base.ctor passando un argomento boolean (base.ctor(bool)). E qui è la cosa. Il Caliburn.Micro.Bootstrapper<TRootModel> nella versione 1.5.1 ha un costruttore con un parametro bool:

public Bootstrapper(bool useApplication = true) : base(useApplication) { 
    this.Start(); 
} 

mentre nella versione 1.5.2, ha un solo parametro-less costruttore:

public Bootstrapper() : base(true) { 
    this.Start(); 
} 

Ecco le firme:

// Assembly: Caliburn.Micro.Autofac, Version=1.5.0.0 
namespace Caliburn.Micro.Autofac { 
    public class AutofacBootstrapper<TRootViewModel> : Bootstrapper<TRootViewModel> { 
     public AutofacBootstrapper() : base(true) { } 
    } 
} 

// Assembly: Caliburn.Micro, Version=1.5.1.0 
namespace Caliburn.Micro { 
    public class Bootstrapper<TRootModel> : BootstrapperBase { 
     public Bootstrapper(bool useApplication = true) : base(useApplication) { 
      this.Start(); 
     } 
    } 
} 

// Assembly: Caliburn.Micro, Version=1.5.2.0 
namespace Caliburn.Micro { 
    public class Bootstrapper<TRootModel> : BootstrapperBase { 
     public Bootstrapper() : base(true) { 
      this.Start(); 
     } 
    } 
} 

Quindi, il Caliburn.Micro.Autofac, Version=1.5.0.0 non può essere utilizzato con Caliburn.Micro, Version=1.5.2.0 e si ha per creare il tuo AutofacBootstrapper, che è facile da implementare facendo riferimento a quello originale (here) o leggendo l'origine dei pacchetti nuget. Inoltre, here è il mio reimplementato, se necessario.

+0

Grazie, mi hai risparmiato un sacco di tempo :) Hai provato a metterti in contatto con Dave ea sistemare il suo pacchetto su GitHub? –

+0

Uro benvenuto. Sì, ho lasciato un commento sul suo blog (post su Caliburn.Micro.Autofac [qui] (http://buksbaum.us/2010/08/20/bootstrapping-caliburn-micro-with-autofac/)) ma non ha non rispondere –

+0

Penso che tu possa solo cambiare e fare una richiesta di commit. –

Problemi correlati