- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 Nuget 安装了 Autofixture 和 Moq。所以我有 moq 版本 4。
运行以下代码时
var fixture = new Fixture().Customize(new AutoMoqCustomization());
fixture.CreateAnonymous<ISomething>();
System.IO.FileLoadException : Could not load file or assembly 'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920'
<configuration>
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="Moq" publicKeyToken="69f491c39445e920" culture="neutral"/>
<bindingRedirect oldVersion="3.1.416.3" newVersion="4.0.10827.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
最佳答案
为了重定向配置文件中的程序集绑定(bind),您需要指定 urn:schemas-microsoft-com:asm.v1
<assemblyBinding> element 中的命名空间,就像在这个例子中:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Moq"
publicKeyToken="69f491c39445e920"
culture="neutral"/>
<bindingRedirect oldVersion="3.1.416.3"
newVersion="4.0.10827.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
If an application is compiled using the .NET Framework 4 runtime but includes a library that was built using an earlier runtime, that library will use the .NET Framework 4 runtime as well. However, if you have an application that was built using an earlier runtime and a library that was built using the .NET Framework 4, you must force your application to also use the .NET Framework 4
关于.net - 自动夹具和最小起订量 v4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6505591/
我是一名优秀的程序员,十分优秀!