Das Modul sollte ein Assemblymanifest enthalten

Ich habe ein Projekt in C #, das C ++ - Bibliothek und einige DLLs verwendet. Wenn ich es laufen lasse, funktioniert es großartig.

Die Bibliothek istAwesomium, enthält sowohl C ++ - Bibliotheks- als auch C # -Wrapper

Wenn ich in meinem ASP.NET MVC 4-Projekt einen Verweis auf dieses Projekt erstelle, wird die folgende Fehlermeldung angezeigt:

Ausnahmedetails: System.BadImageFormatException: Datei oder Assembly 'Datei: /// D: \ Projects \ Development \ ProGamers \ GamingSite \ bin \ avcodec-52.dll' oder eine ihrer Abhängigkeiten konnte nicht geladen werden. Das Modul sollte ein Assemblymanifest enthalten.

Dinge, die ich versucht habe:

Kopieren der DLLs, aber es funktioniert immer noch nicht (Die Datei existiert).

Registrieren Sie es in der GAC, aber ich habe den gleichen Fehler dort.

Stellen Sie sicher, dass Sie .NET Framework 4.0 (und nicht das Client-Profil) verwenden.

2 Dateien mit dem gleichen DLL / EXE-Namen verursachen Konflikte - Ich habe es nicht.

Ändern Sie die Plattform der Lösung zu AnyCPU / Mixed Platforms.

Stack Trace:

[BadImageFormatException: Could not load file or assembly 'file:///D:\Projects\Development\ProGamers\GamingSite\bin\avcodec-52.dll' or one of its dependencies. The module was expected to contain an assembly manifest.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) +102
   System.Reflection.Assembly.LoadFrom(String assemblyFile) +34
   WebActivator.ActivationManager.Run() +190

[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load file or assembly 'file:///D:\Projects\Development\ProGamers\GamingSite\bin\avcodec-52.dll' or one of its dependencies. The module was expected to contain an assembly manifest..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +550
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +90
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load file or assembly 'file:///D:\Projects\Development\ProGamers\GamingSite\bin\avcodec-52.dll' or one of its dependencies. The module was expected to contain an assembly manifest..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9850940
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456

Antworten auf die Frage(5)

Ihre Antwort auf die Frage