0

I'm currently trying to use Pex and Moles with a SharePoint 2010 solution that's written in .NET 3.5. When adding a test project (by using Pex -> Create parameterized tests) everything seems to work OK. However, when I try to compile I end up with a massive list of errors (missing namespaces and such) and warnings regarding referenced assemblies not being able to be resolved (such as System.Web which under .NET 4 is no single DLL anymore).

This is due to the projects under test is .NET 3.5 and the Pex test project is .NET 4.0 as far as I understand it, but is it possible to make this combination work at all?

4

2 回答 2

1

答案在这里:http: //msdn.microsoft.com/en-us/library/system.reflection.assembly.securityruleset.aspx

“默认情况下,使用 .NET Framework 版本 4 编译的程序集具有 2 级透明度,尽管您可以明确地将它们设为 1 级。使用早期版本的 .NET Framework 编译的程序集具有 1 级透明度

于 2012-02-14T10:31:26.273 回答
1

如果将项目 Target Framework 更改为“.Net Framework 3.5”,然后打开项目 AssemblyInfo.cs 文件并注释掉以下行:

[程序集:SecurityRules(SecurityRuleSet.Level1)]

该项目应该建立。我不确定这会如何影响 PEX 及其“探索”。我希望这能让你走得更远一点。

于 2011-08-01T13:24:16.713 回答