Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I have created a project called MonoDevelop.MacDev.Tests. This assembly only references the MonoDevelop.MacDe. I am writing tests purely for types defined in that project.
When i try to run the nunit tests I have designed, i end up in a situation where the tests will not run unless I manually copy all dependencies of MonoDevelop.MacDev to the same directory as MonoDevelop.MacDev.Tests.dll. This should be automatic.
How should the NUnit addin know what assemblies to load, and from where, and in a way that doesn't conflict with your assembly loading requirements?
Your test setup needs to local-copy the assemblies, or use the addin engine to load the assemblies.
Which assemblies do I need to local copy? The only one MonoDevelop.MacDev.Tests depends on is MonoDevelop.MacDev. Am i supposed to guess every single assembly that might be required and add an explicit local-copy reference to it to MonoDevelop.MacDev.Tests? I don't know how visual studio handles this situation. Does it have the same issue?
The reason I mention this is that currently if I do not copy all dependencies locally i get an obscure error message telling me that a type that definitely exists in an assembly which is definitely there could not be loaded:
The reason why the type could not be loaded is because MonoMac.dll was not copied locally. This needs to be reflected in the error message for someone to be able to fix the problem
One more clarification on the original issue, for reference:
VS does behave like MD. NUnit shouldn't second-guess how you expect your assemblies to be loaded, it should use the standard runtime loaders, or it may break tests, so it can't dynamically load the assemblies. And MD *does* transitively local-copy references of references etc, but only if those references are themselves local copy. If they're not, then copying them would be wrong - the program is obviously expecting them to be loaded some other way.
This is why all references are local copy by default, to keep things simple :)
This bug is wrongly classified.
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Visual Studio 2017 for Mac Preview version 7.2, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a reproduction, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.