Asp.net 在Web应用程序中加载文件或程序集时出错

Asp.net 在Web应用程序中加载文件或程序集时出错,asp.net,.net,web,web-applications,.net-assembly,Asp.net,.net,Web,Web Applications,.net Assembly,我需要一些专业的帮助, 我正在尝试在我的服务器上安装DevInfo 7 Web应用程序,SQL server和IIS出现了很多问题,两天后,我成功地修复了它,但是现在IIS和SQL工作正常,我无法克服这个错误,因为我不知道这种语言(顺便说一句,我会添加一些标记,但由于我不懂这种语言,我不确定它们是否与问题相关,如果我选择了错误的标记,请告诉我我接受它!) 如果有人能向我解释什么地方出了问题,或者如何修复它,我将不胜感激,因为我不是在创建Web应用程序(我不知道如何创建),而只是试图安装一个,我可

我需要一些专业的帮助, 我正在尝试在我的服务器上安装DevInfo 7 Web应用程序,SQL server和IIS出现了很多问题,两天后,我成功地修复了它,但是现在IIS和SQL工作正常,我无法克服这个错误,因为我不知道这种语言(顺便说一句,我会添加一些标记,但由于我不懂这种语言,我不确定它们是否与问题相关,如果我选择了错误的标记,请告诉我我接受它!)

如果有人能向我解释什么地方出了问题,或者如何修复它,我将不胜感激,因为我不是在创建Web应用程序(我不知道如何创建),而只是试图安装一个,我可能不理解(请尽可能简单化)

我不知道这是否会改变什么,但我正在Windows Server 2012 x64上安装它

以下是错误:


“/devinfo”应用程序中出现服务器错误。 无法加载文件或程序集“DI5_INIFile”或其依赖项之一。试图加载格式不正确的程序。 描述:在执行当前web请求期间发生未经处理的异常。请查看堆栈跟踪,以了解有关错误及其在代码中起源的详细信息

异常详细信息:System.BadImageFormatException:无法加载文件或程序集“DI5_InFile”或其依赖项之一。试图加载格式不正确的程序

源错误:

在执行当前web请求期间生成了未经处理的异常。有关异常的起源和位置的信息可以使用下面的异常堆栈跟踪来标识

程序集加载跟踪:以下信息有助于确定无法加载程序集“DI5_INIFile”的原因

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].
堆栈跟踪:

[BadImageFormatException: Could not load file or assembly 'DI5_INIFile' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   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.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122

[ConfigurationErrorsException: Could not load file or assembly 'DI5_INIFile' 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) +12761078
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151

[HttpException (0x80004005): Could not load file or assembly 'DI5_INIFile' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601

听起来好像你已经进入了.net版本地狱。当存在冲突的dll版本时,我遇到了这个问题

尝试的事项: 1-清理您的解决方案(右键单击Visual Studio中解决方案树的顶部并单击“清理”),然后重新生成所有解决方案

2——如果不起作用,清除Project的./bin /Debug文件夹,并重复步骤1。如果这是一个Web应用程序,并且你有一个本地版本的IIS正在运行,你应该首先考虑做一个IIS重置。这将释放任何可能在你的bin文件夹中的DLL上的锁。

3-除了第2步,您还可以清除../obj文件夹。不过,清理和重建应该可以为您完成这项工作

4-还要尝试的另一件事是清除临时asp.net文件: del/F/Q“%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\临时ASP.NET文件”

5-如果失败,您需要查看哪个项目正在尝试引用“DI5_INIFile”,并检查其版本号(右键单击dll>属性>版本),然后查看它是否位于web.config中的其他版本号下。 如果是,则可以从项目中删除引用的程序集,并尝试重新添加它

希望有帮助