Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Cannot Debug with Visual Studio using Unity 5.2.1f1

Discussion in 'Scripting' started by Nigey, Sep 30, 2015.

Thread Status:
Not open for further replies.
  1. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    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!
     
  2. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Found issue myself. Ignore this guys lol.
     
  3. Jonathan-Bro

    Jonathan-Bro

    Joined:
    Apr 11, 2013
    Posts:
    35
    So how did you fix it? Having the same problem...
     
  4. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    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.
     
  5. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    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 :)
     
  6. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    Wouldn't it be nice if VSTU team developers could have a tag that says, "VSTU Developer," on the forums?
     
    MrLucid72 likes this.
  7. msfredb7

    msfredb7

    Joined:
    Nov 1, 2012
    Posts:
    143
    If anybody else encountered this issue post-2020 like me. Try regenerating the solution files. This can be done via Preferences>External Tools
    upload_2020-12-30_17-12-44.png
     
    Last edited: Dec 31, 2020
  8. yousseffotouh2013

    yousseffotouh2013

    Joined:
    May 11, 2019
    Posts:
    5
    It worked !
     
  9. harlandpj

    harlandpj

    Joined:
    Jul 15, 2020
    Posts:
    6
    Yep, worked for me!
     
  10. nghien_rbc

    nghien_rbc

    Joined:
    Jun 9, 2018
    Posts:
    1
    You save my day, thanks
     
  11. Dhicci

    Dhicci

    Joined:
    Apr 7, 2016
    Posts:
    2
    Thank you sensei!
     
  12. trollanator5729

    trollanator5729

    Joined:
    May 7, 2018
    Posts:
    5
    worked for me
     
  13. ManFrom

    ManFrom

    Joined:
    Jul 22, 2015
    Posts:
    1
    This man is a hero
     
  14. kbkev78

    kbkev78

    Joined:
    May 17, 2020
    Posts:
    3
    This was the solution. Thank you.
     
  15. chranti

    chranti

    Joined:
    Dec 16, 2021
    Posts:
    2
    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.
     
  16. briandemandiealleskan

    briandemandiealleskan

    Joined:
    Apr 19, 2021
    Posts:
    3
    Thank you very much
     
  17. ChillyRolande

    ChillyRolande

    Joined:
    Apr 20, 2019
    Posts:
    5
    WOWOWOWOWO thank you :) Finally a solution that worked
     
  18. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,533
    I think the Necroing of this post (rather than clicking like) from 2015 has run its course.

    Time to lock the thread.
     
    msfredb7 and Kurt-Dekker like this.
Thread Status:
Not open for further replies.