尽管能够重建解决方案但仍尝试运行项目时,ReflectionTypeLoadException

时间:2018-09-28 14:46:37

标签: asp.net silverlight .net-assembly

尝试设置我的项目

已经安装了RIAServices 3.1版软件包(我需要的软件包)。

无论我做什么,我总是会收到此错误。

  

“ System.Reflection.ReflectionTypeLoadException”类型的异常   发生在mscorlib.dll中,但未在用户代码中处理

     

其他信息:无法加载一个或多个请求的   类型。检索LoaderExceptions属性以获取更多信息。

如何解决此问题(下面有更多详细信息)?谢谢。

 void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        var binDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin");
        var catalog = new DirectoryCatalog(binDir);

        var container = new CompositionContainer(catalog);
        CompositionBatch batch = new CompositionBatch();
        batch.AddPart(IoC.Current);

        try
        {
            container.Compose(batch); (here is where i get the ReflectionTypeLoadException)
        }
        catch (CompositionException up)
        {
            throw up;
        }
    }

这是ExceptionDetail:

    System.Reflection.ReflectionTypeLoadException was unhandled by user code
  HResult=-2146232830
  Message=Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  Source=mscorlib
  StackTrace:
       at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
       at System.Reflection.RuntimeModule.GetTypes()
       at System.Reflection.Assembly.GetTypes()
       at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
       at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
       at System.ComponentModel.Composition.Hosting.DirectoryCatalog.<>c__DisplayClass34_0.<GetExports>b__0(ComposablePartCatalog catalog)
       at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
       at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InnerCatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
       at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
       at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
       at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
       at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
       at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
       at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)
       at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)
       at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart part)
       at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.<>c__DisplayClass19_0.<Compose>b__0()
       at System.ComponentModel.Composition.Hosting.CompositionServices.TryInvoke(Action action)
       at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)
       at System.ComponentModel.Composition.Hosting.CompositionContainer.Compose(CompositionBatch batch)
       at MatrizPCI.Web.Global.Application_Start(Object sender, EventArgs e) in C:\Users\PC003\Desktop\Matriz\Solucao MatrizPCI\Server\MatrizPCI.Web\Global.asax.cs:line 115
  InnerException: 

0 个答案:

没有答案