-
Notifications
You must be signed in to change notification settings - Fork 149
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
TestContext.TestDirectory throws for .net 2.0 DLL #44
Comments
Ok, I have to add that the solution does not always compile correctly (some strange WinCE vs Win32 linking issue, I guess). I'll have to resolve that first, before this can be considered a bug. |
Is it a netcf-3.5 project rather than net-3.5? In that case you need to use the CF build of the nunit framework. |
I just realized that the net20 assembly is not well compatible with net35 due to possibly duplicate definitions of the class ExtensionAttribute. I can't really reproduce it well, although my script deletes bin/obj and rebuilds the whole solution. Eventually, one of the third party libraries I referenced (closed source) defined the ExtensionAttribute, too. The build error I see is CSC : warning CS1685: The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from '[...]\packages\NUnit.3.2.0\lib\net20\nunit.framework.dll' I'll try to track down, which assemblies (apart from nunit.framework) define this attribute. When I remove some of my unused DLLs the problem seems to be gone. Is it possible to built a net35 nunit.framework.dll? I didn't have the issue with version 2.6.4. Edit: No, CF is not the root problem. Unit test project and referenced projects are regular net35 projects. I tried to completely remove the CF project and the problem persists. |
The duplicate definitions problem is logged as nunit/nunit#1349 - there's a temporary workaround there, I believe. |
Using a custom build for net35, this no longer happens. It seems some mixed partially successful build results caused this problem. => invalid & closed. |
NUnit is still compiled for old .net frameworks, which is great. I maintain a shared library used in old VS2008 net35 projects (phone 6.5, ugh) and also used in latest VS2015 net46 projects. Today I tried to transition from NUnit 2.6.4 to 3.2.0 running into current directory issues for resource files (content, copy if newer). Using the
TestContext.CurrentContext.TestDirectory
works fine for recent net46 projects using NuGet to pull NUnit.However, referencing
packages\NUnit.3.2.0\lib\net20\nunit.framework.dll
from VS2008, net35 the call toTestContext.CurrentContext.TestDirectory
throws aNullReferenceException
, eventually because the working directory isnull
.The text was updated successfully, but these errors were encountered: