- Home /
Workaround for UnityVS 1.9.9.0 Overwriting Project References on Every Compile
I'm using Unity Test Tools and UnityVS, and I updated from UnityVS 1.9.8.0 to 1.9.9.0, and now every time I save files and Unity compiles, the project files are overwritten, which destroys references that I've added to the project, "UnityVS.Dystheism.CSharp.Editor", including references to the NUnit framework. This makes Visual Studio's Intellisense (augmented by ReSharper, I don't know if that's necessary or not to flag it as an error when you try and import a dll you don't have) blow up in all my test files.
Putting the dlls that Unity Test Tools provides into the project as files doesn't fix the Intellisense issues. (For some reason, the project file as generated by Unity doesn't)
Is there a good way to make Visual studio recognize these DLLs in a way that Unity won't constantly overwrite? For now I used the Way Back Machine to get an old version of UnityVS.
I'm having the same problem man. UnityVS isn't including the nunit and nsub dlls in the editor assemblies and I have to manually add them in. Checking out an earlier branch seems to fixes this for me which makes me think its the UnityVS dlls in unity that are causing the issue. No idea how to fix it though.
Answer by jbevain · Apr 09, 2015 at 11:53 AM
Hi!
Jb from the Tools for Unity team here.
This is a bug in Unity as you can read in this question.
The workaround is very simple, in the inspector for the DLL, just select All Platforms, as suggested in the post above.
Cheers for the quick reply man. I'm not the OP, but I'm pretty sure we are having the same issue.
Adding a reference to a DLL that is not in the Assets folder ...
The NUnit dlls are included in the "...\Assets\UnityTestTools\UnitTesting\Editor" Folder. I am adding a reference to these dlls manually in visual studio. There are no errors in the unity console and the build only fails when I try to run my unit tests in the resharper test runner.
I have a Unity project which includes the different NUnit DLLs, and they're referenced and I can use them.
Are these the dlls included with UnityTestTools?
Is there any chance you could upload a small project reproducing the issue you're seeing so that we can investigate promptly? Thanks!
I can if you like, but all you will get is a solution that doesn't include the nunit references. Do you want me to stick it on github?
@RetroT$$anonymous$$2 It seems that I'm missing or misunderstanding something :) (wouldn't be the first time!).
Let say I start from scrach, I create a new project, I import the package "UnityTestTools" in my project, I import the VSTU package.
At this point, the nunit DLLs are in:
Assets\UnityTestTools\UnitTesting\Editor\NUnit\Libs
VSTU sees them, and references them in the Editor project.
What am I missing? Comments are probably not the perfect way to figure this out, please feel free to drop me a mail. You can reach my at my username at microsoft.com. Thanks!
VSTU sees them, and references them in the Editor project.
This step doesn't happen for me man, the dlls are not included in the references.
I'll mail you now man