Script

Hello. I am pretty beginner in C#. I had some problems about script. When I run the code, I always getting warning which says "Visual Studio cannot start debugging because the debug target. How can I fix this ? What does it mean ?Can anybody help on this ?

You should not be running the code from inside Visual Studio. You should be pressing PLAY at the top center of the Unity Editor window.

If that’s not the problem, then consider this:

This may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets β†’ Open C# Project from Unity. Other times it requires more.

Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

Barring all that, move on to other ideas:

https://discussions.unity.com/t/778503

Also, try update the VSCode package inside of Unity: Window β†’ Package Manager β†’ Search for Visual Studio Code Editor β†’ Press the Update button

Also, this: https://discussions.unity.com/t/805330/7

1 Like

That is not a Unity script, that is Visual Studio console application code, but you are also trying to run it with VS Forms.

1 Like