Could not load file or assembly 'SharpSvn'

2020-05-05 18:22发布

问题:

I am using SharpSvn.dll and SharpSvnUI.dll in my project . I am getting error like this

Server Error in '/WebUI' Application.

Could not load file or assembly 'SharpSvn' 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 'SharpSvn' or one of its dependencies. An attempt was made to load a program with an incorrect format.

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'SharpSvn' could not be loaded.

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Using : VS 2015 -64bit

ref : https://sharpsvn.open.collab.net/

回答1:

You will get this error if you try to host a web application using a 32 bit dll on a 64 bit server.Quick fix is to set "Enable 32 bit applications" flag to true in AppPool Advance Settings for the site.Select the Application Pool used for the application and the set that flag to true.Restart IIS.



标签: asp.net .net dll