Cannot Debug with Visual Studio using Unity 5.2.1f1

Hey guys,

I was using another version of Unity 5. I think 5.1. The one where you have a folder called UnityVS to debug using VS. I’ve just updated the project with the new Unity version, however I can no longer debug using VS.

I deleted the UnityVS folder as some other threads suggested, but it still does not work :S. I have Visual Studio 2015 Community edition.

The error popping up 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."

Due to my green-ness with Visual Studio, I’m not quite sure how to fix this issue.

Any ideas? Thanks!

Found issue myself. Ignore this guys lol.

So how did you fix it? Having the same problem…

It’s just repairing the VSTU installation. If that doesn’t work, manually move the VSTU package in the “Program Files (x86) / Unity / Editor / Standard Assets” and move it to the x64 equivalent.

Source: Had same issue on lab computers. Made this change to fix it.

Firstly make sure you have this downloaded https://visualstudiogallery.msdn.microsoft.com/20b80b8c-659b-45ef-96c1-437828fe7cf2 (whatever’s the right version), make sure there isn’t a UnityVS folder in your asset directory. Lastly go to the ‘Help’ option at the top of Unity and click on ‘About Unity…’, that’ll have some text on the bottom left mentioning it recognises the Visual Studio tools you’ve downloaded.

Also on the link read through the link in this bit:
Unity 5.2 users, read our documentation about Unity’s native support for VSTU.

Hope that helps :slight_smile:

Wouldn’t it be nice if VSTU team developers could have a tag that says, “VSTU Developer,” on the forums?

1 Like

If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences>External Tools

37 Likes

It worked !

Yep, worked for me!

You save my day, thanks

Thank you sensei!

worked for me

This man is a hero

This was the solution. Thank you.

This also did the trick for me, thank you! The cause in my case was that I had moved my Unity project to a different location, this seemed to resolve the path issues VS had.

Thank you very much

WOWOWOWOWO thank you :slight_smile: Finally a solution that worked

I think the Necroing of this post (rather than clicking like) from 2015 has run its course.

Time to lock the thread.

2 Likes