我有一个类似于System.BadImageFormatException的错误:无法加载文件或程序集.但是解决错误的条件是不同的.
测试名称:Test_DisableTestUserAccount
测试FullName:
测试源:
测试结果:失败
测试持续时间:0 :00:00结果消息:
无法获取#typename#类型.错误:System.IO.FileLoadException:无法加载文件或程序集'ComponentName.IntTest,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = a433f9a8cee952'或其依赖项之一.强名称验证失败.(来自HRESULT的异常:0x8013141A)
文件名:'ComponentName.IntTest,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 433f9a8cee952'---> System.Security.SecurityException:强名称验证失败.(来自HRESULT的异常:0x8013141A)
失败的程序集区域是: System.Reflection.RuntimeAssembly._nLoad中的
MyComputer
(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark&stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,
布料suppressSecurityChecks)在System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark&stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef) ,证据assemblySecurity,RuntimeAssembly reqAssembly,StackCrawlMark&stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFi 乐,证据securityEvidence,字节[]散列值,AssemblyHashAlgorithm的HashAlgorithm,布尔forIntrospection,布尔suppressSecurityChecks,StackCrawlMark&stackMark)
在System.Reflection.Assembly.LoadFrom(字符串assemblyFile)
在Microsoft.VisualStudio.TestPlatform.MSTestFramework.TypeCache.LoadType(字符串的typeName,字符串assemblyName)
条件:
当我运行将访问控制台应用程序的内部元素的单元测试用例时,测试用例将失败并抛出异常.
| 归档时间: |
|
| 查看次数: |
7757 次 |
| 最近记录: |