Ho la seguente mappatura nel mio file xml Castello di Windsor che ha lavorato bene (invariato) per qualche tempo:aggiornamento Castello di Windsor provoca TypeLoadException per i tipi generici
<component id="defaultBasicRepository"
service="MyApp.Models.Repositories.IBasicRepository`1, MyApp.Models"
type="MyApp.Models.Repositories.Linq.BasicRepository`1, MyApp.Models"
lifestyle="perWebRequest"/>
ho ottenuto questo dalla documentazione Windsor ai http://www.castleproject.org/container/documentation/v1rc3/usersguide/genericssupport.html.
da quando ho aggiornato Windsor, io ora ottenere la seguente eccezione in fase di esecuzione:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: GenericArguments[0], 'T', on 'MyApp.Models.Repositories.Linq.BasicRepository`1[TEntity]' violates the constraint of type parameter 'TEntity'.
Source Error:
Line 44: public static void ConfigureIoC()
Line 45: {
Line 46: var windsor = new WindsorContainer("Windsor.xml");
Line 47:
Line 48: ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(windsor));
sto usando ASP.NET MVC 1.0, Visual Studio 2008 e il Castello di Windsor, come scaricato da http://sourceforge.net/projects/castleproject/files/InversionOfControl/2.1/Castle-Windsor-2.1.1.zip/download
Can qualcuno fa luce su questo? Sono sicuro che l'aggiornamento di Castle Windsor è ciò che l'ha causato - funziona da anni.
UPDATE:
ho fissato io stesso alla fine. Vedere my answer qui sotto per i dettagli.