Visual Studio单元测试:不信任dll [英] Visual Studio Unit Tests : dll is not trusted
问题描述
我正在努力运行一些单元测试,并想知道是否有人可以提供一些有见地的东西.
I'm struggling getting some unit tests running and wondering if anyone might have anything insightful.
设置是服务器上有一堆引用的DLL,当我尝试执行时,我得到了旧的
The setup is that we've got a bunch of referenced DLL's on a server and when I try and execute I get the old
测试运行部署问题: 文件或目录的位置 'c:\ source \ ProjectName \ bin \ debug \ 3rdPartyLibrary.dll' 不可信.
Test Run deployment issue: The location of the file or directory 'c:\source\ProjectName\bin\debug\3rdPartyLibrary.dll' is not trusted.
我尝试了旧的caspol命令:
I've tried the old caspol command:
caspol -m -ag 1.2 -url文件:\ server \ binaries * FullTrust
caspol -m -ag 1.2 -url file:\server\binaries* FullTrust
这似乎可以解决所有问题,但一个DLL除外.当前,每次执行测试项目的构建时,我都必须手动更改权限,这很痛苦.有人有什么建议吗?顺便说一下,运行Win7 64位操作系统.
Which seems to work for everything bar one DLL. I'm currently having to manually change the permissions everytime I do a build of the test project, which is a pain. Anyone have any suggestions? Running a Win7 64bit OS btw.
推荐答案
Ian拥有为我启动修复程序的密钥.我试图在Windows 7 64bit上使用WatiN,并不断收到不可信"错误.这是我要修复的步骤.
Ian had the key that started the fix for me. I'm attempting to use WatiN on Windows 7 64bit and kept getting the "not trusted" error. Here are the steps I took to fix it.
- 关闭VS.
- 从程序文件(x86)删除WatiN目录
- 导航到我的用户目录.搜索并删除WatiN dll.
- 导航到我的项目目录.搜索并删除所有WatiN dll.
- 重新下载WatiN.
- 右键单击.zip文件,然后在复制操作之前取消阻止内容.
- 在程序文件(x86)下重新创建WatiN目录,然后从.zip中复制文件.
除非得到流浪的WatiN dll的VS,否则它将继续访问不受信任的DLL并让您发疯.
Unless you get the stray WatiN dll's VS will continue to access the untrusted DLL's and drive you nuts.
这篇关于Visual Studio单元测试:不信任dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!