不能加载某个版本的程序集 (Could not load file or assembly '***' or one for its dependencies)
问题描述:
在更改Nuget中某个package的版本的时候经常遇到不能加载某个版本的dll,原因可能是因为你用Nuget已经安装过一个版本后面你又要用nuget改成老版本,但是Nuget没有改掉webconfig中对应的版本号,所以出错
问题截图:

解决方案:
webconfig中手动改掉对应version

问题描述:
自己新建了一个测试项目,引用了别人的项目或者dll,结果发现
“System.IO.FileNotFoundException”类型的未经处理的异常在 mscorlib.dll 中发生
其他信息: 未能加载文件或程序集“ZhuantiApi.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。
后来发现需要自己建个配置文件,然后将你添加的项目中的配置文件的runtime标签复制过来,编译后调试就OK了
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.9.12.0" newVersion="6.9.12.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration

浙公网安备 33010602011771号