为什么 Moles 选择 .NET v4.0 的 SharePoint.Behaviors,而其余的都是 v3.5?
我有一个 ClassLibrary 访问 SharePoint 2010 对象模型,作为更大的 SP 2010 沙箱解决方案的一部分。所有项目都以 .NET v3.5 为目标(不是客户端配置文件)。然后有一个 ASP.NET WebApplication 项目用于测试 ClassLibrary - 仍然是 .NET v3.5。
我正在尝试使用 Microsoft Moles 来模拟 SPContext.Current - 我已经知道并使用过 - 我遇到了这个问题:在每次构建时,moles 框架将始终选择 Microsoft.SharePoint.Behaviors 运行时 DLL v4.0.30319,以便将其复制到 MolesAssemblies 中。对于 Microsoft.SharePoint.Moles
,它选择 v2.0.50727。
顺便说一下,这些只是在 C:\Program Files\Microsoft Moles\MolesAssemblies\Microsoft.SharePoint\14.0.0.0__71e9bce111e9429c 中找到的 DLL。但我记得在Moles安装过程中,v4.0和v3.5的moles都被创建了。
有没有办法告诉 Moles 构建和/或复制运行时 v3.5 的 DLL? 或者我应该建造一个特殊的地方来存放它们,以便让鼹鼠捡起它们?
不知何故,我还查看了构建期间创建的临时选项文件(...\obj\Debug\Moles\moles.args
),最后一个选项实际上是 /clrversion:v2。 0.50727 /clrversion2 /targetframeworkversion:v3.5
。
环境:Windows 7 64位、VS 2010 SP1、Moles v0.94.51023.0 - .NET v4.0.30319(仅安装Moles,无Pex)。
I have a ClassLibrary accessing SharePoint 2010 object model as part of a bigger SP 2010 Sandbox solution. All projects target .NET v3.5 (not client profile). Then there's a ASP.NET WebApplication project used to test the ClassLibrary - still .NET v3.5.
I'm trying to use Microsoft Moles in order to mock SPContext.Current - which I already know and have used - and I run into this problem: upon each build, the moles framework will always pick the Microsoft.SharePoint.Behaviors
DLL for runtime v4.0.30319 in order to copy it into MolesAssemblies. Instead for Microsoft.SharePoint.Moles
it picks v2.0.50727.
Incidentally those are just the DLLs found in C:\Program Files\Microsoft Moles\MolesAssemblies\Microsoft.SharePoint\14.0.0.0__71e9bce111e9429c
. But I remember during Moles install that both v4.0 and v3.5 moles were created.
Is there a way to tell Moles to build and/or copy the DLL for runtime v3.5?
Or is there a special place were I should build and store them, in order to let Moles pick them up?
Somehow I also had a look at the temporary options file created during build (...\obj\Debug\Moles\moles.args
) and the last options are actually /clrversion:v2.0.50727 /clrversion2 /targetframeworkversion:v3.5
.
Environment: Windows 7 64bit, VS 2010 SP1, Moles v0.94.51023.0 - .NET v4.0.30319 (Moles only install, no Pex).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论