痣和 SharePoint 行为类型 [英] Moles and SharePoint Behaviour types
问题描述
我们在使用以下代码时遇到问题:
We are having problems with the following code:
BSPSite site = new BSPSite();
BSPWeb web = site.SetRootWeb();
错误是:无法加载文件或程序集System.Moles, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0ae41878053f6703"或其依赖项之一.系统找不到指定的文件.
The error is : Could not load file or assembly 'System.Moles, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0ae41878053f6703' or one of its dependencies. The system cannot find the file specified.
我们曾尝试将源代码中的 Behavoir 程序集重建为 .NET 4,但没有成功.我们使用的是 v0.94.
We have tried rebuilding the Behavoir assembly in the source code to .NET 4 but that didn't go through. We are using v0.94.
任何帮助将不胜感激.
推荐答案
1) 转到 C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssemblies
1) Go to C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssemblies
2 ) 找到 Microsoft.Moles.VsHost.x86.exe.config
2 ) Find Microsoft.Moles.VsHost.x86.exe.config
3) 通过在运行时添加下一行来打开和更改
3) Open and alter by adding next lines under runtime
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Moles" publicKeyToken="0ae41878053f6703" culture="neutral"/>
<bindingRedirect oldVersion= "4.0.0.0"
newVersion= "2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
这篇关于痣和 SharePoint 行为类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!