The "Attach to Unity" button disappears from VS 2015.

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:

3364073--263596--atu2.png

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.

the team is aware of it, b4 still broken so maybe b5, but at the speed they’re pumping out incremental betas, b19 :wink:

try 2018.1.b4 … I don’t have the problem anymore… for now :slight_smile:

I notice a few issues with VS reloading needlessly and closing the open solution on b4 myself.

yeah I made a post about that issue here https://discussions.unity.com/t/689239

The debug button going missing was an issue I had in b3 but somehow was fixed after installing b4 so no idea why its happening for others.

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:

3366971--263859--vse.png

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:

3366971--263860--vse2.png

I do like those bugs that just go away

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

Hi

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.

Regards
Sebastien Lebreton [MSFT]

3 Likes

Thanks Sebastien, much appreciated.

1 Like

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.

Same problem here.

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.

1 Like

fix?

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.

Sounds to me like VSTU integration is loaded correctly to me. To be sure, in the Help Menu in Visual Studio, do you have a “Unity API Reference” ?

@sailro , @jbevain , can you help get to the bottom of this?

No I don’t have that option, this is what I see on the VS help menu:

3391512--266647--vsh.png

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.

@georgeq , could you please send us your project files here: vstusp[at]microsoft[dot]com.

  • your exact VS, VSTU versions (Help/About VS)

Thanks!

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”…

Hope this helps…

Thank you very much!

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.

Thanks Sebastian!

1 Like

This is where the version is, beyond up to date, debug button shows up 25% of the time.