如何在.NET中启用程序集绑定失败日志记录(Fusion)?
我遇到了一个疯狂的系统负载问题,我不知道它是什么。错误和输出
Server Error in '/' Application. Cannot load a reference assembly for
execution. 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: Cannot load a
reference assembly for execution.
Run Code Online (Sandbox Code Playgroud)
源错误:
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 …Run Code Online (Sandbox Code Playgroud) 我必须在我的应用程序中使用第三方DLL.DLL是32位,我使用的系统是64位操作系统.
我在我的DotNet应用程序(framework-4.5)中导入了32位DLL,如下所示
[DllImport("Sample.dll",
EntryPoint = "Add",
CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
public static extern int Add(int iA, int iB);
Run Code Online (Sandbox Code Playgroud)
在IIS 7.5中 - 我将"启用32位应用程序"设置为"True".
并尝试将编译器管理器设置为 - X86,x64和任何CPU.
但是所有的尝试都会导致相同的错误
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题......
.net ×2
c# ×2
32bit-64bit ×1
assemblies ×1
binding ×1
c#-4.0 ×1
dllimport ×1
iis ×1
msbuild ×1
vb.net ×1