# Cannot Debug with Visual Studio using Unity 5.2.1f1

**URL:** <https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [September 30, 2015, 8:55am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604 "2015-09-30T08:55:28Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nigey](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/nigey/32/109840_2.png) [@Nigey](https://discussions.unity.com/u/Nigey)\
**Post date:** [September 30, 2015, 8:55am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/1 "2015-09-30T08:55:28Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Nigey](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/nigey/32/109840_2.png) [@Nigey](https://discussions.unity.com/u/Nigey)\
**Post date:** [September 30, 2015, 9:38am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/2 "2015-09-30T09:38:54Z")

</div>

Found issue myself. Ignore this guys lol.

---

<div class="post-metadata">

**Author:** ![Jonathan-Bro](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jonathan-Bro](https://discussions.unity.com/u/Jonathan-Bro)\
**Post date:** [October 1, 2015, 3:49am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/3 "2015-10-01T03:49:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![asperatology](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@asperatology](https://discussions.unity.com/u/asperatology)\
**Post date:** [October 1, 2015, 6:27am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/4 "2015-10-01T06:27:31Z")

</div>

> [@Jonathan Bro](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Nigey](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/nigey/32/109840_2.png) [@Nigey](https://discussions.unity.com/u/Nigey)\
**Post date:** [October 1, 2015, 7:17am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/5 "2015-10-01T07:17:10Z")

</div>

Firstly make sure you have this downloaded [https://visualstudiogallery.msdn.microsoft.com/20b80b8c-659b-45ef-96c1-437828fe7cf2](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](http://unityvs.com/documentation/native-support/).**

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![asperatology](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@asperatology](https://discussions.unity.com/u/asperatology)\
**Post date:** [October 1, 2015, 8:09am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/6 "2015-10-01T08:09:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![msfredb7](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/msfredb7/32/884301_2.png) [@msfredb7](https://discussions.unity.com/u/msfredb7)\
**Post date:** [December 30, 2020, 10:13pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/7 "2020-12-30T22:13:11Z")

</div>

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

 ![6673258--764194--upload_2020-12-30_17-12-44.png](https://europe1.discourse-cdn.com/unity/original/4X/6/2/b/62b340b8310efac298c52fbb0d75506bc8f0cf91.png)

---

<div class="post-metadata">

**Author:** ![yousseffotouh2013](https://avatars.discourse-cdn.com/v4/letter/y/e495f1/32.png) [@yousseffotouh2013](https://discussions.unity.com/u/yousseffotouh2013)\
**Post date:** [December 31, 2020, 12:02pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/8 "2020-12-31T12:02:11Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Trying regenerating the solution files. This can be done via Preferences\>External Tools

It worked !

---

<div class="post-metadata">

**Author:** ![harlandpj](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/harlandpj/32/988822_2.png) [@harlandpj](https://discussions.unity.com/u/harlandpj)\
**Post date:** [January 12, 2021, 1:15pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/9 "2021-01-12T13:15:54Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

Yep, worked for me!

---

<div class="post-metadata">

**Author:** ![nghien\_rbc](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@nghien\_rbc](https://discussions.unity.com/u/nghien_rbc)\
**Post date:** [February 23, 2021, 9:12am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/10 "2021-02-23T09:12:40Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

You save my day, thanks

---

<div class="post-metadata">

**Author:** ![Dhicci](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@Dhicci](https://discussions.unity.com/u/Dhicci)\
**Post date:** [March 20, 2021, 1:17am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/11 "2021-03-20T01:17:38Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

Thank you sensei!

---

<div class="post-metadata">

**Author:** ![trollanator5729](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/trollanator5729/32/452276_2.png) [@trollanator5729](https://discussions.unity.com/u/trollanator5729)\
**Post date:** [March 29, 2021, 10:31pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/12 "2021-03-29T22:31:28Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

worked for me

---

<div class="post-metadata">

**Author:** ![ManFrom](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@ManFrom](https://discussions.unity.com/u/ManFrom)\
**Post date:** [May 5, 2021, 1:15pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/13 "2021-05-05T13:15:56Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

This man is a hero

---

<div class="post-metadata">

**Author:** ![kbkev78](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kbkev78](https://discussions.unity.com/u/kbkev78)\
**Post date:** [June 6, 2021, 11:36am UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/14 "2021-06-06T11:36:13Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

This was the solution. Thank you.

---

<div class="post-metadata">

**Author:** ![chranti](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chranti](https://discussions.unity.com/u/chranti)\
**Post date:** [January 1, 2022, 5:18pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/15 "2022-01-01T17:18:49Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

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.

---

<div class="post-metadata">

**Author:** ![briandemandiealleskan](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@briandemandiealleskan](https://discussions.unity.com/u/briandemandiealleskan)\
**Post date:** [January 7, 2022, 12:46pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/16 "2022-01-07T12:46:46Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

Thank you very much

---

<div class="post-metadata">

**Author:** ![ChillyRolande](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@ChillyRolande](https://discussions.unity.com/u/ChillyRolande)\
**Post date:** [January 27, 2022, 2:49pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/17 "2022-01-27T14:49:49Z")

</div>

> [@msfredb7](#):
>
> If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences\>External Tools

WOWOWOWOWO thank you 🙂 Finally a solution that worked

---

<div class="post-metadata">

**Author:** ![MelvMay](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/melvmay/32/548775_2.png) [@MelvMay](https://discussions.unity.com/u/MelvMay)\
**Post date:** [January 27, 2022, 3:00pm UTC](https://discussions.unity.com/t/cannot-debug-with-visual-studio-using-unity-5-2-1f1/599604/18 "2022-01-27T15:00:32Z")

</div>

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

Time to lock the thread.
