无法加载因为它不在Appbase下
我通过在 中选择我的测试项目创建了一个 NUnit 项目 (NunitLoginTest.nunit) >nunit\bin
目录,现在我尝试加载该项目,但它给了我以下错误。
无法加载 由于它不在 Appbase 下,因此无法加载文件或程序集“nunitLogintest”或其依赖项之一。 系统找不到指定的路径
与什么有关? 我还检查了我的配置文件。 我从控制台运行这个。
更新:
我想启动 NUnit,然后它应该加载某个目录中的 Visual Studio 项目,然后运行所有测试(如果我没有在任何 NUnit 项目中定义它)。
实际上我想创建一个批处理文件来运行这一切。 当我这样做时,它不会加载该项目。 我已经在环境变量中定义了 c:\Program Files\nunit\bin 路径。
I have created an NUnit project (NunitLoginTest.nunit) by selcting my test project in the nunit\bin
directory and now I am trying to load that project, but it is giving me the following error.
Unable to load Because it is not located under Appbase, could not load file or assembly "nunitLogintest" or one of its dependencies. The system cannot find the specified path
What is it related to? I have also checked my configuration file. I am running this from console.
Update:
I want to start NUnit, and then it should load my Visual Studio project that is in some directory and then run all the tests (if I don't define it in any NUnit project).
Actually I want to create a batch file to run all this. When I do this it won't load the project. I have defined the c:\Program Files\nunit\bin path in the environment variable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在某些情况下,您必须自行填写ApplicationBase。 主菜单,Project,Edit,填写DLL文件所在的ApplicationBase。
You must fill in the ApplicationBase by yourself in some cases. Main menu, Project, Edit, fill ApplicationBase where the DLL file is.
当我运行 NUnit 测试时,我不会创建 XXX.nunit 项目文件。 我在控制台输入:
在您的情况下,您有一个 .nunit 文件,其中列出了要测试的程序集。 确保从执行 nunit-console.exe 的位置正确解析文件中的路径。 我的示例具有程序集的完整路径,因此我可以从任何位置运行 nunit-console.exe。
nunit 文件看起来像这样:
appbase 设置指示在哪里优化要测试的程序集。 所以程序集的完整路径是appbase + 程序集路径。
When I run my NUnit tests, I don't create a XXX.nunit project file. At the console I type:
In your case, you have a .nunit file that list the assemblies to test. Make sure the paths in the file are resolving correctly from where you are executing nunit-console.exe. My example has the full path to the assembly so I can run nunit-console.exe from any where.
The nunit file looks something like this:
The appbase setting indicates where to fine the assemblies to test. So the full path to the assembly is appbase + assembly path.
如果在 VISTA 下运行,您必须是管理员。
If running under VISTA, you must be an Admin.
我在 Vista 上也遇到了同样的“无法加载,因为它不在 Appbase 下”消息。
原因是我试图将 nunit 项目保存在 nunit 程序目录中。
我将保存位置更改为文档中的某个位置,效果很好。
我认为如果我按照雷迪的建议以管理员身份登录,它也会起作用。
I had the same "Unable to load Because it is not located under Appbase" message on Vista.
The cause was me trying to save the nunit project in the nunit program directory.
I changed the location of the save to somewhere in my documents and it worked fine.
I think it would have also have worked if I logged in as admin as reddy suggested.