Unity Visual Studio Debug Problem

If you are getting an error when you try to built your project in Unity in Visual Studio, you can get rid of this error by following the steps below.

Let's first see what the error is..

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 references the library project. Set the executable project as the startup project.

The reason for this error is that Unity Debugger cannot Attach to Visual Studio.

The following steps should be followed to resolve the error.

  • 1 - "Debug" is opened from the menu.
  • 2 - Select "Attach Unity Debugger".
  • 3 - Select your project from the list in the drop-down menu and press OK.

Note : This error is usually not always received. If you are constantly getting this error, Visual Studio Updates should be checked.



You May Interest

Running Your Unity Project From Any Visual Studio You Want

What is Unity StartCoroutine ?

What is Unity Sprite ?

What is Unity Tag?

Adding a Button Property to an Object in Code in Unity