Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indirect path in .nunit project file causes nunit3-console.exe 3.2.1 to crash #1505

Closed
toomanypeople opened this issue May 18, 2016 · 4 comments

Comments

@toomanypeople
Copy link

toomanypeople commented May 18, 2016

A project file tests.nunit with contents

<NUnitProject> <Settings activeconfig="Release"/> <Config name="Release"> <assembly path="..\MyProject.Test\bin\Release\MyProject.Test.dll"/> </Config> </NUnitProject>

run from cmd like so:
D:\projects\MySolution\MyTestStuff>"nunit3-console.exe" tests.nunit

causes the nunit console to crash with this error message:

Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.

Moving everything back a directory and updating the tests.nunit like so causes the test to run normally. The crash seems to be caused by the ".." in the project file path.

<assembly path="MyProject.Test\bin\Release\MyProject.Test.dll"/>

Doing this from the command-line also works correctly:

D:\projects\MySolution\MyTestStuff>"nunit3-console.exe" ..\MyProject.Test\bin\Release\MyProject.Test.dll

@ChrisMaddock ChrisMaddock added this to the Backlog milestone May 18, 2016
@CharliePoole
Copy link
Contributor

CharliePoole commented May 18, 2016

In the first (failing) command, the appbase is set to the location of the project file by default. This makes it impossible to load assemblies that are not in or below that directory.

Options...

  1. Move the project file into a directory that encloses all the assemblies to be loaded.
  2. Set the appbase explicitly in the project file.

@ChrisMaddock ChrisMaddock removed this from the Backlog milestone May 18, 2016
@toomanypeople
Copy link
Author

Charlie, would you mind explaining what you mean by 'appease' and 'soonest'? Just looking at the .nunit config file example in the docs I can't figure out what you're talking about.

https://github.com/nunit/docs/wiki/NUnit-Test-Projects

@CharliePoole
Copy link
Contributor

I hate auto-correct! Appbase in both cases.

@toomanypeople
Copy link
Author

toomanypeople commented May 18, 2016

Heh, thanks. That makes much more sense.

If anyone finds this through google, here's what I should have done if I want to put my .nunit file in a sub-directory:

<NUnitProject> <Settings activeconfig="Release"/> <Config name="Release" appbase="..\"> <assembly path="MyProject.Test\bin\Release\MyProject.Test.dll"/> </Config> </NUnitProject>

@rprouse rprouse modified the milestone: Closed Without Action Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants