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

How to Adjust Unity Screen Rotation Settings?

What is Unity Header and Space Feature?

Reaching All Child Objects of Unity GameObject

What is Unity Idle?

Searching Multiple GameObjects By Unity Tag