Search Unity

Cant start visual studio debugger (VS 2017, Unity 2017) anymore

Discussion in 'Code Editors & IDEs' started by Desoxi, Aug 21, 2017.

  1. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    Hey,

    until now i never had any problems with visual studio and attaching it to the unity editor. But somehow im not able to start the visual studio debugger anymore.
    This is the response i get:

    upload_2017-8-21_16-34-36.png

    "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."

    I am using:
    Visual Studio 2017
    Unity 2017.1.0p3

    EDIT: To clarify a few things: I was able to debug through attaching visual studio to unity via this button until now:

    upload_2017-8-21_16-59-31.png

    But as you can see it only says "Start" and not "Attach to unity and start". Of course i can still start it via Debug->Attach to Process but thats a real pain in the arse to do everytime i want to debug my stuff.
    Never had this problem with VS15 and never used Tools for Unity in VS.
    I even tried to install it but the button remains the same.
    I would appreciate any help in bringing back the attach to process shortcut..
     
    Last edited: Aug 21, 2017
  2. iperov

    iperov

    Joined:
    Dec 13, 2015
    Posts:
    36
    same problem. I go back to vs2015
     
  3. Samuraihyun

    Samuraihyun

    Joined:
    Feb 1, 2017
    Posts:
    1
    Install Visual Studio 2017
     
  4. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    I've come up with the save problem, how did you fix that???
     
  5. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    To be honest i dont remember fixing it. I just switched back to VS15 on my office pc because i still had it installed and set up. On my private pc im using VS2017 without any problems so far.
    If you really want to use vs2017 and cant get rid of the problem even after a restart, reinstall of unity etc, you can manually attach the debugger to a process via Debug -> Attach to process.. (ctrl+alt+p) and then pick the unity.exe from the list.

    But that is really a pain because you have o do it each time you want to debug.
     
  6. ikriz

    ikriz

    Joined:
    Dec 3, 2009
    Posts:
    98
    You need to install the game development features for Unity for Visual Studio (mainly the Visual Studio Tools for Unity) then you will have an Attach to Unity button instead of just the plain Start
     
  7. unity_djyFJulwcfpaUg

    unity_djyFJulwcfpaUg

    Joined:
    Mar 24, 2020
    Posts:
    2
    I have found the solution that worked for me. navigate to the project folder and delete all files that start with the name of "Assembly-CSharp" this reset the assembles.
     
  8. Wynellrussell

    Wynellrussell

    Joined:
    Apr 28, 2020
    Posts:
    3
    Rebuilding Unity's Asset Database by deleting the Library folder of the Unity project fixed the issue.
     
  9. baalo

    baalo

    Joined:
    Nov 21, 2016
    Posts:
    1
    Following worked for me:
    First: Close Visual Studio
    Then: In The Unity Editor Menu go to: Assets > Open C# Project
    Visual Studio opens and the project can be attached to the unity instance as usual.