痣和SharePoint行为类型 [英] Moles and SharePoint Behaviour types

查看:89
本文介绍了痣和SharePoint行为类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在使用以下代码时遇到问题:

We are having problems with the following code:

        BSPSite site = new BSPSite();
        BSPWeb web = site.SetRootWeb();

错误是: 无法加载文件或程序集'System.Moles,版本= 4.0.0.0,区域性=中性,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.0 \ Common7 \ IDE \ PrivateAssemblies

1) Go to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆