I am working on a project in Unity for a couple of months now. The last couple of days an issue appeared with my Visual Studio client, without realising how.
On the debugging toolbar, there is no "Attach to Unity" button to start debugging the project, but instead the button now says "Start". If i try to press it i get the following error, also shown in the screenshot:
A project with an Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which referances the library project. Set the executable project as the startup project.
I have found out this question here that explains how to fix that error, but in my case it does not work: A project with an Output Type of Class Library cannot be started directly
In that thread there are two fixes suggested.
Fix a) the assembly i want to debug is already set as the "Statup Project", and
Fix b) right clicking on the assembly i m working on and going to properties i get the following error:
More specific for my case, when i open my .cs files in Unity and Visual Studio launches, i now get this error:
This suggests that my Unity settings are not set for Visual Studio as an external tool, which is false, since i have configured that a long time ago and have never made any changes since then to those settings. In fact going there to double check Visual Studio is indeed set as the external tool to use.
The problem must be occuring because of that last error, cause when i launch VS momentarily i can see the "Attach to Unity" button, the error pops up and the button changes to "Start" after that.
What i m thinking is that since i have updated VS lately, the external tools might be referancing still the previous version, but since the VS file directory is a mess i cant figure out if that is the case, and i do have seperate .exe files for the different versions or if it is something else that causes this issue.
Any help will be much appriciated since i m in the dark here!