-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fails to resolve assembly for base type of TestFixture if placed in a different dll #147
Comments
|
I was using latest extension available for vs2017. But was also seeing the issue when building from source (master) The two assemblies are side by side in the output directory of the test assembly project. I could see the tests in the test explorer but was unable to run them. When trying to run the test the output was that it could not load my test assembly due to missing dependency. |
Just to confirm: you are using the NUnit (2) VS Adapter and not the NUnit 3 VS Adapter, right? |
That is correct and also the latest nunit 2 release to go with it. |
See comment on #143 , contains a zip file with nuget and vsix with a beta fix |
Your version solves my issue. I used the VSIX. Thank you! When can I expect this as part of a normal release? |
I am a bit uncertain. I'm waiting for @CharliePoole's answer to my last comment in #143. It will probably be in 2.2, but it could also be out on a beta-feed. The version number will be above the one you have now, so it will be upgrade-able. The same applies for the nuget package. |
@OsirisTerje I checked #143 but didn't see any questions for me to answer. |
When will you release 2.2? I just had to help a fellow developer getting the custom build from the zip you provided to be able to run our unit tests. It has been almost a year... I do not understand what is holding back a release. |
Sorry for being unclear. We try to not release updates to the 2.X series, instead see what prevents people from moving to NUnit3. Are there any particular things that prevents this? In itself this fix do deserve a new release, but it would be interesting to hear what is your upgrade blocker. |
I'm closing the issue, as the PR is merged to master. |
@initram The pre-release package for the 2.2 adapter is now available on https://www.myget.org/feed/nunit/package/nuget/NUnitTestAdapter If you could check it out, it would be awesome. |
Wow, a blast from the past... We have since migrated to NUnit 3 and no longer have this issue. But good luck with your release. |
@initram Good to hear that you have migrated! That is what we want to hear :-) |
We have a set of classes that are used as base classes for several TestFixtures in many different projects, so they have been placed in their own project and compile to a separate dll (that is placed next to the assembly containing our TestFixture).
When I try to run my unit tests Mono.Cecil fails to load the assembly containing the base class. After debugging the issue it seems that the working directory is not set correctly when trying to resolve the base type of a TestFixture class. I managed to fix my issue by setting the working directory before trying to resolve a base class.
I Changed NavigationDataProvider.cs:56 from
typeDef = typeDef.BaseType.Resolve();
to
var tmp = Directory.GetCurrentDirectory(); Directory.SetCurrentDirectory(Path.GetDirectoryName(typeDef.Module.FullyQualifiedName)); typeDef = typeDef.BaseType.Resolve(); Directory.SetCurrentDirectory(tmp); // be a good citizen and reset path to what it was before.
I do not really like this way of solving the problem, but I do not know the codebase well enough to come up with a proper fix for this.
If you want me to create a pull request with my changes or create a reproduction solution, then let me know.
The text was updated successfully, but these errors were encountered: