使用 .NET 3.5 项目运行 Pex
我目前正在尝试将 Pex 和 Moles 与用 .NET 3.5 编写的 SharePoint 2010 解决方案结合使用。 添加测试项目时(通过使用 Pex -> 创建参数化测试)一切似乎都正常。 然而,当我尝试编译时,我最终遇到了大量错误(缺少命名空间等)以及有关引用程序集无法解析的警告(例如 System.Web 在 .NET 4 下不再是单个 DLL) 。
据我了解,这是因为正在测试的项目是.NET 3.5,而Pex测试项目是.NET 4.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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果将项目目标框架更改为“.Net Framework 3.5”,然后打开项目 AssemblyInfo.cs 文件并注释掉以下行:
[程序集:SecurityRules(SecurityRuleSet.Level1)]
项目应生成。我不确定这会如何影响 PEX 及其“探索”。我希望这能让你在路上走得更远。
If you change the project Target Framework to ".Net Framework 3.5" and then open the project AssemblyInfo.cs file and comment out the following line:
[assembly: SecurityRules(SecurityRuleSet.Level1)]
the project should build. How this affects PEX and its "Explorations" I am not sure. I hope this gets you a little further down the road.
答案在这里:http://msdn.microsoft。 com/en-us/library/system.reflection. assembly.securityruleset.aspx
The answer is here: http://msdn.microsoft.com/en-us/library/system.reflection.assembly.securityruleset.aspx