Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio doesn't put binaries of Unity project to output folder

I’m working on a solution containing default Unity project (Assembly-CSharp).

I added a test project to the solution with a reference to Assembly-CSharp. According to IntelliSense, the test project does see the types from Assembly-CSharp, however when I’m trying to build the solution, I’m getting the following error:

Metadata file 'MyProjectFolder\Temp\bin\Debug\Assembly-CSharp.dll' could not be found.

Thus, I'm not able to run unit tests on my Unity project.

Indeed, when I’m building the Unity projects, the .\Temp\bin\Debug folder remains empty even though the build is recognized as successful by VS.

like image 870
Павле Avatar asked Oct 30 '25 02:10

Павле


2 Answers

The problem is caused by Disable the full build of projects setting which is new in Unity Tools extension. It prevents the binaries to be created, which speeds up situations when they're not actually being used, like when starting the debugger.

enter image description here

Turning this setting off in Visual Studio settings fixes the issue. Now all build products are placed in ./Temp/bin/Debug folder and I can run unit tests.

Feature request

I made a feature request to VS to make it possible to define this setting at solution level, so that you can have 1 solution for speed and 1 for unit testing. I hope it will get enough votes up: https://developercommunity.visualstudio.com/idea/798543/make-it-possible-to-manipulate-the-disable-the-ful.html

like image 110
Павле Avatar answered Oct 31 '25 17:10

Павле


I have the same problem, and regenerate project files did the trick.

Edit => Preferences => External Tools => Regenerate Project Files

like image 27
Suejung Avatar answered Oct 31 '25 15:10

Suejung