Zainstalowałem program ELMAH 1.1 .Net 3.5 x64 w moim projekcie ASP.NET, a teraz otrzymuję ten błąd (za każdym razem, gdy próbuję wyświetlić dowolną stronę):Nie można załadować pliku lub zestawu "System.Data.SQLite"
Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.
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.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Więcej szczegółowych informacji o błędach na dole.
Moja platforma Active Solution to "Dowolny procesor" i korzystam z x 64 systemu Windows 7 na procesorze x64. Powodem, dla którego używamy tej wersji ELMAH jest to, że 1.0 .Net 3.5 (x86, która jest jedyną platformą, dla której została skompilowana) dała nam ten sam błąd na naszym serwerze Windows x64.
Próbowałem kompilacji dla x86 i x64 i pojawia się ten sam błąd. Próbowałem usunąć wszystkie wyjście kompilatora (bin i obj). Wreszcie zrobiłem odniesienie do SQLite dll bezpośrednio, coś, co nie było potrzebne do realizacji projektu, aby pracować na serwerze i mam ten błąd kompilatora:
Error 1 Warning as Error: Assembly generation -- Referenced assembly 'System.Data.SQLite.dll' targets a different processor MyProject
jakieś pomysły co może być problem?
Więcej informacji o błędach:
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46[ConfigurationErrorsException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232
System.Web.Compilation.BuildManager.CompileGlobalAsax() +52 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337[HttpException (0x80004005): Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729[HttpException (0x80004005): Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8896783
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
Dziennik łączenia (wiążące wiązanie) jest znacznie bardziej przydatny w takich przypadkach niż ten arkusz śledzenia stosu. –
Wygląda na to, że problem polega na tym, że Cassini to x86. – Pablo
Miałem ten sam problem i musiałem zrezygnować z ELMAH z powodu mieszanego środowiska produkcyjnego/rozwojowego, jakie mamy. Biorąc pod uwagę, że używanie SQLite na serwerze produkcyjnym o dużym natężeniu ruchu nie brzmi zbyt dobrze i fakt, że SQLite dll jest jedynym zestawem w ELMAH, który zmusza go do posiadania dwóch różnych wersji dla bitów x86 i 64x, zastanawiam się dlaczego faceci ELMAH ciągną to i sprawiają, że opcjonalne, a nie to, co jest teraz. – Khash