博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Could not load file or assembly 'System.Web.Http
阅读量:5280 次
发布时间:2019-06-14

本文共 10805 字,大约阅读时间需要 36 分钟。

使用FusLogVw

You can use to find out who is loading the old assemblies, just define a path for the log, and run your solution, then check (in FusLogvw) the first line where the Unity assembly is loaded, double click it and see the calling assembly, and here you go.

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\Developer Command Prompt for VS 2017 (2)  

 

 

如何使用

I usually use the Fusion Log Viewer ( from a Visual Studio command prompt or Fusion Log Viewer from the start menu) - my standard setup is:

  • Open Fusion Log Viewer as administrator
  • Click settings
  • Check the Enable custom log path checkbox
  • Enter the location you want logs to get written to, for example, c:\FusionLogs (Important: make sure that you have actually created this folder in the file system.)
  • Make sure that the right level of logging is on (I sometimes just select Log all binds to disk just to make sure things are working right)
  • Click OK
  • Set the log location option to Custom

Remember to turn of logging off once you're done!

(I just posted this on a similar question - I think it's relevant here too.)

 

实例

在页面中搜索application对应的编码,发现存在临时文件,需要将这个文件夹删除C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_60_dev_cmsweb11\931fe700\6226aa26

将application下面所有的文件夹以及文件删除,然后使用visual studio重新编译项目

 

*** Assembly Binder Log Entry  (2018/10/31 @ 13:44:32) ***The operation failed.Bind result: hr = 0x80131040. No description available.Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dllRunning under executable  c:\windows\system32\inetsrv\w3wp.exe--- A detailed error log follows. === Pre-bind state information ===LOG: DisplayName = System.Net.Http.Formatting (Partial)WRN: Partial binding information was supplied for an assembly:WRN: Assembly Name: System.Net.Http.Formatting | Domain ID: 4WRN: A partial bind occurs when only part of the assembly display name is provided.WRN: This might result in the binder loading an incorrect assembly.WRN: It is recommended to provide a fully specified textual identity for the assembly,WRN: that consists of the simple name, version, culture, and public key token.WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.LOG: Appbase = file:///C:/Users/clu/source/repos/Edenred/LISA_6.0.0.0/Kentico11/LISA.Kentico11/LOG: Initial PrivatePath = C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\binLOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_60_dev_cmsweb11\931fe700LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_60_dev_cmsweb11\931fe700LOG: AppName = 6226aa26Calling assembly : (Unknown).===LOG: This bind starts in default load context.LOG: Using application configuration file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\web.configLOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.configLOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Users/clu/source/repos/Edenred/LISA_6.0.0.0/Kentico11/LISA.Kentico11/bin/System.Net.Http.Formatting.DLL.LOG: Assembly download was successful. Attempting setup of file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\bin\System.Net.Http.Formatting.dllLOG: Entering download cache setup phase.LOG: Assembly Name is: System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.LOG: Using application configuration file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\web.configLOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.configLOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.LOG: Redirect found in application configuration file: 5.2.3.0 redirected to 5.2.6.0.LOG: Post-policy reference: System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35LOG: GAC Lookup was unsuccessful.LOG: The post-policy assembly reference requires probing again.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Users/clu/source/repos/Edenred/LISA_6.0.0.0/Kentico11/LISA.Kentico11/bin/System.Net.Http.Formatting.DLL.LOG: Assembly download was successful. Attempting setup of file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\bin\System.Net.Http.Formatting.dllLOG: Entering download cache setup phase.LOG: Assembly Name is: System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35WRN: Comparing the assembly name resulted in the mismatch: Build NumberERR: The assembly reference did not match the assembly definition found.ERR: Setup failed with hr = 0x80131040.ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.*** Assembly Binder Log Entry  (2018/10/31 @ 13:44:32) ***The operation failed.Bind result: hr = 0x80131040. No description available.Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dllRunning under executable  c:\windows\system32\inetsrv\w3wp.exe--- A detailed error log follows. === Pre-bind state information ===LOG: DisplayName = System.Net.Http.Formatting (Partial)WRN: Partial binding information was supplied for an assembly:WRN: Assembly Name: System.Net.Http.Formatting | Domain ID: 4WRN: A partial bind occurs when only part of the assembly display name is provided.WRN: This might result in the binder loading an incorrect assembly.WRN: It is recommended to provide a fully specified textual identity for the assembly,WRN: that consists of the simple name, version, culture, and public key token.WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.LOG: Appbase = file:///C:/Users/clu/source/repos/Edenred/LISA_6.0.0.0/Kentico11/LISA.Kentico11/LOG: Initial PrivatePath = C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\binLOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_60_dev_cmsweb11\931fe700LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\lisa_60_dev_cmsweb11\931fe700LOG: AppName = 6226aa26Calling assembly : (Unknown).===LOG: This bind starts in default load context.LOG: Using application configuration file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\web.configLOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.configLOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Users/clu/source/repos/Edenred/LISA_6.0.0.0/Kentico11/LISA.Kentico11/bin/System.Net.Http.Formatting.DLL.LOG: Assembly download was successful. Attempting setup of file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\bin\System.Net.Http.Formatting.dllLOG: Entering download cache setup phase.LOG: Assembly Name is: System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.LOG: Using application configuration file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\web.configLOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.configLOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.LOG: Redirect found in application configuration file: 5.2.3.0 redirected to 5.2.6.0.LOG: Post-policy reference: System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35LOG: GAC Lookup was unsuccessful.LOG: The post-policy assembly reference requires probing again.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/lisa_60_dev_cmsweb11/931fe700/6226aa26/System.Net.Http.Formatting/System.Net.Http.Formatting.DLL.LOG: Attempting download of new URL file:///C:/Users/clu/source/repos/Edenred/LISA_6.0.0.0/Kentico11/LISA.Kentico11/bin/System.Net.Http.Formatting.DLL.LOG: Assembly download was successful. Attempting setup of file: C:\Users\clu\source\repos\Edenred\LISA_6.0.0.0\Kentico11\LISA.Kentico11\bin\System.Net.Http.Formatting.dllLOG: Entering download cache setup phase.LOG: Assembly Name is: System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35WRN: Comparing the assembly name resulted in the mismatch: Build NumberERR: The assembly reference did not match the assembly definition found.ERR: Setup failed with hr = 0x80131040.ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

 

 

 

 

 

 

转载于:https://www.cnblogs.com/chucklu/p/9754054.html

你可能感兴趣的文章
Unity调用Windows窗口句柄,选择文件和目录
查看>>
HashMap循环遍历方式
查看>>
React Native 入门 调试项目
查看>>
C# 通过 Quartz .NET 实现 schedule job 的处理
查看>>
关于java之socket输入流输出流可否放在不同的线程里进行处理
查看>>
目前为止用过的最好的Json互转工具类ConvertJson
查看>>
Day13
查看>>
tensorflow saver简介+Demo with linear-model
查看>>
Luogu_4103 [HEOI2014]大工程
查看>>
Oracle——SQL基础
查看>>
项目置顶随笔
查看>>
Redis的安装与使用
查看>>
P1970 花匠
查看>>
java语言与java技术
查看>>
NOIP2016提高A组五校联考2总结
查看>>
iOS 项目的编译速度提高
查看>>
table中checkbox选择多行
查看>>
Magento开发文档(三):Magento控制器
查看>>
性能调优攻略
查看>>
ie6解决png图片透明问题
查看>>