I was working with Unity 2018.1.0b3 and I was debugging some code on Visual Studio 2015, everything was fine until suddenly the “Attach to Unity” button disappeared, there was no crash, nor a program restart, nothing unusual it just simply disappeared, and now I see “Start” instead. I tried closing both Unity and VS and restarting them again but that didn’t solve the problem. Just after the project finishes loading on VS the “Attach to Unity” button’s label is replaced with “Start”.
It seems someone had the same problem with a previous version of Unity, and he seemed to solved it by switching to MonoDevelop and back on the preferences/external tools window, but since Unity 2018 no longer comes with MonoDevelop that’s not an option . I tried switching to Visual Studio 2017, but I have exactly the same problem. I don’t know how the two programs a linked, but it is pretty obvious that this link breaks just after the project finishes loading.
I’m trying to solve the problem somehow, so I changed the external script editor to Unity’s 2017 MonoDevelop, and when I try to debug the code it shows me this:
So I think that process is the root of this problem, however, if open the Windows’ task manager I can find such process, so there’s no way I can kill it… I’m restating the PC and see what happens.
… It seems there’s another kind of problem since restarting the computer didn’t solve it.
… also this seems to affect only 2018, because if I open the project with 2017.3 I don’t have this problem.
I uninstalled b3 and then installed b4, but that didn’t solve the problem. Moreover, if I create a brand new project with b4 and try to open a newly created script I get this:
The “Attach to Unity” button doesn’t appear, instead there’s “Attach…” and if I click it, I get a list of programs which I guess are listening to certain port:
No idea why it no work for you in b4… Am using Stable c#3.5 for the project… I know that before I was testing with Experimental C#4.5 in the player prefs
We investigated with Unity this case where Unity 2018 beta was not properly delegating to VSTU the generation of solution and project files. Because of this, you ended up with a regular C# solution so all VSTU features regarding debugging, wizards, reloading, etc… were disabled in VS.
It was a registration issue, that was just fixed in Unity beta. We also patched VSTU to be more resilient about those issues.
We expect the fix to be soon available in Unity beta.
According to this: https://unity3d.com/es/unity/beta-download this problem has been solved on b6, but it is not!.. I’m still experiencing the same problem, even deleting the solution files and forcing a full rebuild.
What are the exact repo steps, could you perhaps report a bug on the issue?
Does your solution in VS have a project named “Assembly-CSharp” as in the screenshot in the first post in this thread? If so, then VSTU integration was not loaded correctly. If you do not have it, then I think the issue is a different one from the one that was fixed in b6.
I don’t have an “Assembly-CSharp” project instead I have “projectname”.CSharp… with a dot instead of an underscore. I don’t know if having an assembly definition file affects the naming.
No I don’t have that option, this is what I see on the VS help menu:
I just upgraded to b7… and now I’m having a new problem: if I delete the VS solution files, they are not rebuilt automatically when there’s an assembly definition file. Now I must delete the ADF in order to get the VS solution rebuilt. I had the same problem with 2017.3.1 (Case 998820), but apparently that was solved on 2018.1.b… however it seems this bug has been reintroduced in 2018.1.0b7, since I didn’t had to delete the AD files on previous betas.
I just sent you a project with which hopefully you’ll be able to reproduce the problem… if you open this project with Unity 2017.3.1 or 2018.1.0b7 the VS solution files are not rebuilt automatically but this problem does not occur on 2018.1.0b3 though b6. The only possible way to get this files rebuilt automatically to delete all the assembly definition files.
You will also see that the “Attach to Unity” button (in VS 2015) sometimes changes to “Start” and other times to “Attach to process”…
So the problem was that VSTU was outdated… I thought this component upgraded automatically every time you install a new version of Unity, but that’s not the case, and VS also fails to do the upgrade, so if anyone is having the same issue, make sure you have the latest version… you can download it here.