当我尝试从我的解决方案下的一个文件夹运行单元测试时,我收到此错误
单元测试运行程序未能运行测试 System.Security.VerificationException 操作可能会破坏运行时
当我为整个解决方案运行单元测试时,所有测试加上这些测试都运行良好。我尝试将规则集设置为 level1 [assembly: SecurityRules(SecurityRuleSet.Level1)] 但这也不起作用
我的组装信息看起来像
[assembly: AssemblyTitle("CommonTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("d30f8726-fc9f-4cd0-986e-a2ed5ea0a5cd")]
和 globalassemblyinfo.cs 看起来像
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.MainAssembly)]
[assembly: CLSCompliant(false)]