A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in '2018.2 Beta' started by LeonhardP, Jan 25, 2018.
And you should be able to use Command ⌘-Shift-M for the unity messages wizard
No worries, glad to hear you're all set!
Hey, @jbevain and @sailro
Sometimes I'm getting weird issue - I can't attach to the Unity from the VS for debug.
I see Unity instance at the Attach to Unity dialog:
But when I select it and press OK this dialogue closes and I can see nothing literally happens.
It doesn't enter debug mode and doesn't attach Unity,
Same for the Attach to Unity button at the VS toolbar (except it compiles things).
I was on latest official release of VSTU and Unity 5.6 + VS 2017. 15.5.7 and updated VSTU to the latest version you posted on the previous page but it didn't helped.
Are there any kind of logs anywhere where I could check what could be wrong?
This usually means that the VSTU debugger can not open a connection to the TCP server in Unity's scripting runtime.
Sometimes it means that the «Allow Editor Attaching» setting in Unity is set to false.
Most of the times it means that the debugger server in Unity's scripting engine has crashed, and that you'll need to restart Unity.
I'll make a note to add some logging to the VS output window when we fail there.
Thanks for your quick reply, @jbevain !
Though I have Editor Attaching enabled and did tried to restart Unity, restart VS, restart both of them, clean all VS files in the project directory, clean Library folder and reimport project in Unity - all without any luck.
The interesting thing it worked once today, then I changed some code and it stopped to work.
It happened before too on other projects with other Unity versions (including 2017.*) but usually clean reimport and / or restart of all helped, but not today =\
Will try to reboot PC, it should help I believe.
That would be very helpful!
PC reboot fixed the issue, debugger can attach again.
Perhaps you tried the following, but just in case:
Unable to attach
Try to temporarily disable your antivirus or create exclusion rules for both VS and Unity.
Try to temporarily disable your firewall or create rules for allowing TCP/UDP networking between VS and Unity.
We identified that programs like Team Viewer are interfering with process detection; perhaps you can try to stop temporarily any extra software to see if it changes something.
Do not rename the main Unity executable, as VSTU is only monitoring "Unity.exe" processes.
I'm using only Windows Firewall (with Windows Firewall Control wrapper) and it doesn't block Unity and VS connections (they are added to the allowed) and I have no AV (even disabled the built-in Windows Defender antivirus).
Also I'm not using anything like TeamViewer, and didn't renamed Unity executables.
Strange part it works initially and then suddenly stops to work.
I've rebooted PC and it works again (didn't removed or added any other software, just rebooted a PC).
For now I'm safe, though would be nice to know a bit more about possible causes of the issue in the feature (e.g. see the crash message on the Unity side, in Editor log or as a message box, see some information on the VS side - why it was not able to connect) to be able somehow troubleshoot it or at least make a good bug report with more details for you guys.
Thank you both @sailro and @jbevain for the quick reaction and great support, as always!
Are you still using the script you posted or mine? He explained why the reloading still happens with your method, since it triggers changed csproj files on all of them I guess. The script I posted does what yours did and more, and my project isn't full reloading anymore on 15.6. I also made sure to remove or change any other "OnGeneratedCSProjFiles" scripts in my project.
@sailro Came upon a slight issue as a result of your recommendation, the script will throw an exception for team members who do not have visual studio installed since the code to interface with that comes from VS I guess and not Unity? So do you know if there is a pre-processor macro for if VS-Unity-Bridge is installed so we can prevent this?
(which also brings up another point about how VS doesn't give you a list of macros when you type #if, a feature I sorely miss from Monodevelop).
You can wrap the script in a:
Let me check with my Intellisense people about code completion for compilation symbols.
While you talk to them, can you also ask where those fixes are at?
After installing latest VSTU 188.8.131.52 from this thread, I started to see new kind of issue: duplicate tabs
Steps to reproduce:
- open Unity project in Unity
- double-click any class in the Project view, so VS starts, opens solution of your project and opens double-clicked class
- close VS
- double-click on the same class in Unity's Project view, VS stats again, opens solution and opens double-clicked file in new tab, with name:2, like on the screenshot above.
Unity 5.6, VS 15.5.7
Been noticing this issue for some weeks, not sure it's recent but definitely an issue.
In beta 9 why Unity force me to install visual studio? I don't want to install it. What option do I have to deselect it?
Waiting for solution.
@rahuxx make sure you've deselected this option
Sorry to mention, I am using Unity Hub and in that I am not able to deselect Visual Studio.
I'm not exactly sure what I'm looking at. Are those Unity bug numbers? If so, I don't have access to those.
Are those bugs related to Visual Studio or code completion? If so, they'd be better reported over at:
We've heard about this, but we've never been able to find a consistent repro. Do you folks have a project + method to consistently reproduce this?
It should only be greyed out if you already have VS installed. It's supposed to indicate that it won't be downloaded again, although I agree that it's confusing. I passed the feedback on to the Hub team.
You def should have access to those. I clicked on that link and there was no entry field to copy paste the bug reports, I don't feel like exploring yet another web site because quite frankly I'm saturated with reporting bugs so I'll let Unity help me with that, @LeonhardP could you please send this man a copy of these bug numbers?
Note: VS is now an integral part of unity but different companies mean no access to unity fogbugz, which I understand, but what can be done is add a VS category to the reporter and give microsoft access to those.
Happening again =( Maybe I can help in catching this up somehow?
I've just tried to reproduce and have no luck with it. It seems to happen accidentally and I still can't figure out how to reproduce it in 100% cases.
Hi, I seem to be able to do it consistently, here is a simple project with a blank script.
-Open the project in Unity
-Double click the TestScript file from within Unity editor to have it launch VS.
-Make an edit, save it, click on Unity so that it recompiles, and then close VS.
-Double click the TestScript file again, it should open with a duplicate tab of the script.
Even just simply opening the script, closing VS with the tab still there, and double-click opening it again to launch VS would make more and more tabs.
And of course I can't repro
Which version of Unity + VS are you using?
Quick question: are you starting the debugger without a project loaded?
I'm afraid filing Visual Studio bugs at Unity is completely unproductive for everyone involved.
For Unity it increases their QA workload instead of focusing on Unity.
For Visual Studio it means not being to track properly the issue.
For the user who's negatively impacted by the bug, it means there's a significant chance the bug will be either not fixed, not understood by Unity's QA, not well dispatched, and in the end, you have the live with the bug longer than you could have by filing it at the right place.
(At that point that's just common sense)
You can file Visual Studio bugs either from Visual Studio itself (the send feedback icon in the top right corner) or on:
Better yet, if your issue is related to C# code completion / code coloration, this part is open-source and you can interact directly with the developers at:
Here's an example of a bug report there:
Both Unity and VS projects are properly loaded at that moment.
Unity is not in the Play Mode.
Looks like I managed to reproduce that double tabs, as @Invertex described.
Just closing VS with any class opened in a tab and double-clicking same class in Unity opens VS with duplicate tab for that class.
Interesting thing, now it even doesn't show ":1" or ":2", just two tabs with same name:
VS preview 15.6 p6 and Unity 2017.3.1p1
Just tried latest update for the preview (p7) and also just updated regular VS Community to the new 15.6 release. Issue still seems to happen with both.
VSTU shows version 184.108.40.206
So you're asking unity users to file reports themselves to microsoft and in your post you show me one that was filed by one of yours guys on behalf of a Unity QA guy and it is fixed, proving that if a bug gets reported to unity it follows the right channel and gets fixed.
At this point I can’t even. We’re just trying to help users and be productive.
What’s with the attitude, Laurent?
You're starting to be kinda rude. You especially should understand by now how backed up Unity's Feedback system already is. Are you saying you'd actually want it to go through Unity's system and then to the VS team instead of simply directly to them? Why? You're getting mad at them for Unity's inability to direct all the VS related bug reports to them... Yeah exceptions to the norm happen like the situation you pointed out, but that isn't the report chain we should expect or want.
Don't get overly sensitive, I am just pointing out that your link is proving exactly my point: that MS and Unity QA talking is super efficient and should be the way it's done.
Also I am sure you are aware that individuals don't get much pull at MS, I remember going through Azure UX fiasco and seeing so many complaints on the forum met by the most polite replies, but a year pass and the UX swapped to default, almost unchanged.
I have good experience with microsoft in many many ways but bug reporting is not one of them. This is why I don't want to go through another Azure and be yet another unheard voice by the microsoft juggernaut.
(now to temper this, I followed your advise and logged a few of the autocomplete bugs through that interface, I'd love to be proven wrong)
Thanks folks. I'll need to reach out to my core team to help investigate this, and I'll get back to you.
@jbevain do you think there's a chance it'll move away from full project regeneration ever? It would be nice to be able to support things like assembly binding redirects and make manual csproj changes.
And nuget support...
I sure would like bi-directional support for csprojs, but it also sounds like a lot of work for Unity.
You should let them know, wink wink.
Already started that process as well.
Will there be a solution for the excessive amount of reloads required with Unity 2018.1 beta 10? I have deleted the solution and the rebuilt one still stresses me so. What can be done? I even tried Rider out which doesn't have this issue.
Have you made sure there are no OnGeneratedCSProjectFiles() scripts in your project? That was the source of the issue for us. Now the only time it does a full reload is when a new assembly is added/removed.
Also you can greatly speed up the load time using my script here that cleans up Unity's junk filled csproj files.:
I updated VS and the reload nagging went away but now checking VS's blue status bar I see it is reloading automatically and often - but taking an awfully long time about it... I have to wait ages when double clicking a file from within Unity. It appears to be reloading constantly except the only change is it is hiding the dialog boxes.
I tried your script but it's still taking forever to open files from within Unity. Sad, version 15.6.1
Are you using the beta VS Tools for Unity posted earlier in this thread? https://forum.unity.com/threads/issues-with-visual-studio-unity.514304/#post-3409391
It solved the solution reloading issues I was having with Unity 2018.1 + VS2017.
That was it. Thank you, not sure how I missed it! Thanks everyone.
FYI, the support for the project generator in Unity 2018.1 is scheduled to be released in Visual Studio 15.6.2, on or about this week.
Hey guys. I'm recently using 2018.1.0b10 and noticed the broken VS Tools for Unity. Sadly the 220.127.116.11 aren't available for VS 2012 which I'm using. Will it be available for VS 2012 later or do I have to switch my IDE too?
18.104.22.168 will be available for Visual Studio 2015 and Visual Studio 2017.
Dunno where suggestions would go for the addon so just leaving it here, but wondering if it would be possible to have the Solution Explorer not show all the folders that lead up to the location of the Assembly Definition? It's pointless to show those folders, since an asmdef folder only has access to its children. Would go a long way towards cleaning up the solution explorer.
Normally this isn't a problem for the usual VS project, but with this asmdef system, the csproj file is often located many parent folders up, completely disconnected from where the assembly's files are.
I imagine the simplest solution to this without having to deal with relocating a bunch of stuff and generating proper references would be to simply support an attribute on <Compile> elements in the csproj which would be something like :
<Compile StripPath="Assets\Plugins\" Include="Assets\Plugins\MyPlugin\Script.cs" />
Or even just have it as a top level attribute that can be referenced.
Then have the Solution Explorer strip that portion from being displayed in the hierarchy.
Even better would be for VS to simply support a relative-source-root parameter.
Why don't you simply use the Unity project viewer in VS? (View -> Unity Project Explorer). That will give you the project using the Unity folder structure?
While that works for simple interaction and it's nice it exists, it lacks nearly all the right-click options that Solution Explorer offers (and that installed extensions may add). The SE also allows you to know for sure which scripts are part of what assembly and focus on specific assemblies (once you've cleaned out the junk includes that are currently being added). If Unity is going to be pushing this Assembly Definition workflow, then it seems silly to not properly represent the assemblies in the solution explorer. But since there's no way as far as I know yet to define a deeper folder as the root of your source files in VS, it makes it fairly messy right now.
Just for the records, I've submitted a Case 1014650 to the Unity about my problem with VS connection to the Unity socket with as much info as possible (Bug Reporter has a limitations on report characters count, so I tried to shrink report a bit without loosing important information to fit there).
Ah I see what you mean.
Yeah we're currently working on revamping our project system based on the modern C# project system (we're currently using the legacy one in VS). This should give us more control over how we can display the Solution Explorer, including possibly cleaning the folder hierarchy when using asmdefs. It's still a little bit down the line though.