-
Notifications
You must be signed in to change notification settings - Fork 153
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
AppDomain.CurrentDomain.BaseDirectory is directory nunit-agent.exe #1313
Comments
There are not workarounds? |
Can you explain a bit about what you are trying to accomplish by changing the base directory and what you've tried so far? We'll need a bit more info to better understand and help. As a general piece of advice, there are some work arounds and code samples listed in here which may help for your use case: nunit/nunit#1072 And there's some command line options which may help depending on what you're trying to do (for example, |
@stevenaw NUnit traditionally ran tests in a separate AppDomain, which it created. The .NET Framework agents still do that. You can find the key code in the Historically, this is due to the fact that our first runners for .NET Core were dealing with versions 1.0 and 1.1, where almost none of the features of I'm going to create an identical issue to this one in the TestCentric Gui because the same problem exists there. I'll post or link here if I figure something out. If you take this on, feel free to consult me offline. |
I'm wondering why a .NET 6.0 test assembly, is expecting there to be more than one AppDomain in a process... i.e. the primary AppDomain. Perhaps this is not a bug at all. Is this an x/y problem? Why do you need the ApplicationBase to match the current test assembly? |
We have switched to dotnet test where the behaviour is still correct. |
I'm pretty much convinced that this is not a bug.
@OsirisTerje I'm inclined to close this. Do you want any others on the team to review it first? |
Personally, I think it is fine to close this issue |
Hello! I think you are aware of this behavior. But just in case, one more time.
I have seen many people mention this feature in issues. But I didn't see any workaround for this.
I can't use TestContext because the call to AppDomain.CurrentDomain.BaseDirectory is used in a third-party library.
About csproj:
Command
C:\NUnit.Console-3.16.2\bin\nunit3-console.exe C:\src\solution\Ttest.Project\bin\Test.Project.dll --where id=1-1002
Value of AppDomain.CurrentDomain.BaseDirectory
C:\NUnit.Console-3.16.2\bin\agents\net6.0\
Questions:
The text was updated successfully, but these errors were encountered: