Visual Studio debugging for Unity is finally here!

Discussion in 'Discussion' started by kersk, Aug 24, 2012.

  1. Wagenheimer

    Wagenheimer

    Member

    Joined:
    Aug 22, 2013
    Messages:
    90
    My UnitVS always locks my Unity after a debugging when using Breaking Points....

    | click stop on Visual Studio and after Stop on Unity, but when I try to run it again on Visual Studio my Unity locks.

    Am I doing something wrong?
     
  2. AndyLL

    AndyLL

    Member

    Joined:
    Aug 25, 2013
    Messages:
    63
    I have not had those issues and I've been stepping through code quite a bit the last few days. I'm using VS2012.

    When you say: 'click stop' in VS you mean you are stopping the debugger? If so then you have to also stop 'play' in Unity.... killing the debugger does not stop Unity.

    If I forget to stop Unity after stopping the debugger... or vice versa... restarting usually causes exceptions but does not freeze up.
     
  3. RvBGames

    RvBGames

    Member

    Joined:
    Oct 22, 2013
    Messages:
    141
    I purchased this about a year ago (I think). It hung quite a bit then so I disabled it. Is anyone having success with it now?

    AndyLL states yes, while Wagenheimer expresses similar issues I stumbled on. Is anyone else using this with real success and not just with a simple test project?
     
  4. AndyLL

    AndyLL

    Member

    Joined:
    Aug 25, 2013
    Messages:
    63
    The project I've been working on is fairly complex.

    I have a navel simulation backend library that originally was written in Desktop C++, converted to .Net, converted to Java for an android game, and then reconverted back to .Net for Unity.

    It consists of 100s of classes and fairly complex data structures and calculations.

    I bought UnityVS just to help ease the task of getting this library to work under Unity.

    It hasn't been without issues... however I'm not sure many of the current issues are not inherent on remote debugging a game engine that is relying on timed events and threads to function.

    I have had issues:

    1) Occasionally VS2012 and Unity would become 'de-linked'. Once that happened I could no longer debug or open scripts until I rebooted. A quick support email (answered overnight ) suggested using the 'Open with VSUnity' off the menu when this happened and it did fix the problem. This would have been a show stopper if they didn't give me that workaround.

    2) Occasionally when I hit a breakpoint my local variables 'go out of scope' and I can't view them. It's strange because they will be viewable for a few minutes then become unviewable. I'm assuming there are Unity threads/events still processing which is causing this. Work around is to put the variable in a watch window before the break and click it right away after the break... everything seems to stay in focus when I do that.

    3) Can't reset the instruction pointer. Not surprised by this.

    4) Occasionally Unity crashes. As a fairly new user of Unity I'm not sure if this is Unity, debugging, or VSUnity.

    As someone that has worked professionally using Visual Studio for decades I am more then willing to put up with these minor issues in order to use the VS environment.
     
  5. Wagenheimer

    Wagenheimer

    Member

    Joined:
    Aug 22, 2013
    Messages:
    90
    Sorry my english is not very good, but I'm sure I can reproduce the hang, I will try to make a Video and post it here... but the step by step is something like this :

    - Hit Play of Unity
    - Press F5 on Visual Studio (To Start Debugging)
    - Pause on a Breakpoint
    - Press Stop on Visual Studio (To Stop)
    - Press Stop on Unity

    If happens 50% of time, now, if I try to start the Debugging again pressing F5 on Visual Studio, Unity will hang and I will be not able to click play! I need to End Process of Unity and start everything again.
     
  6. RvBGames

    RvBGames

    Member

    Joined:
    Oct 22, 2013
    Messages:
    141
    @Andy, I've been using VS since it's inception. And to deal with the type of issues that you are seeing is unacceptable. I've been getting by with Debug.Log() but would much rather have true VS integration.

    Would you happen to have turbulence code written in C# that you would be willing to share?

    I'm about to read through and convert some parts of JSBSim Flight Dynamics Model (http://jsbsim.sourceforge.net/JSBSim/index.html) for my current project. Of course I'd rather leverage something already written if possible.

    Thanks.
     
  7. MrProfessorTroll

    MrProfessorTroll

    New Member

    Joined:
    Sep 1, 2013
    Messages:
    383
    Well honestly, Blender is the best IDE I have used so far. Works like a charm. Take a look:

    $IDE.JPG
     
  8. AndyLL

    AndyLL

    Member

    Joined:
    Aug 25, 2013
    Messages:
    63
    Hmmm... my post must have come across wrong. Once my issue #1 went away I've been exceedingly happy with UnityVS. Tonight I've spent the last 3 hours tracing through Tidy Tile Mapper to learn how its put together and I've had 0 issues.

    After reading Wagenheimer's post I tried various combinations of starting/stopping both Unity and VS and could not get either to freeze.

    I have no regrets in purchasing the product... I'd do it again.

    Nope. Mine is a whole lot of WWII navel code. Mostly Lat/Long calculations and generating convoys traveling through the shipping routes.

    Pretty specific to my game however if I ever come up with a polished system to map world lat/long coordinates to unity scenes I might put together a package.
     
  9. RvBGames

    RvBGames

    Member

    Joined:
    Oct 22, 2013
    Messages:
    141
    @MPT, the first error I get is "Blender could not convert the .blend file to FBX file." in Unity 4.2.2

    The steps I took:

    1. Created an empty Unity project
    2. Created a Blender project with the sample cube
    3. Save the Blender project into the Unity Assets folder
    4. Alt Tab

    Then I got the error.

    Tried to delete the project directory and start again, but Windows display's a "Try again" message, which I'm assuming some rogue process didn't close down and has some part of the directory locked/opened. Able to delete everything manually but the empty Asset folder.

    Created another project and when switching to Unity a Microsoft Visual Studio dialog popped up:

    "The following files were specified on the command line: -b -p These files could not be found and will not be loaded."

    Different question: why doesn't Blender honor the keys on my keyboard. I hate numlock, always have it off, and use the Home/End/Insert/Delete and Arrow keys all the time.
     
  10. MrProfessorTroll

    MrProfessorTroll

    New Member

    Joined:
    Sep 1, 2013
    Messages:
    383
    you have an interesting problem. Try reporting the bugs. What is your os? I am running Windows 8.1 64 bit. Try troubleshooting. Usually Blender simplifies my workflow so I can put in 50% less effort but get out 110% more work done.
     
  11. ProjectOne

    ProjectOne

    Member

    Joined:
    Aug 9, 2010
    Messages:
    439
    Hi,
    Was considering the new Mac Book Pro 2013 possibly the 15inch version

    Any new mac book pro user experiencing any issue with UnityVS maybe running Visual Studio under Virtual Machine?
    Thank you
     
  12. davecazz

    davecazz

    Member

    Joined:
    Dec 27, 2013
    Messages:
    2
    Having an issue with unityVS in parallels and unity on the mac.

    My VS/UnityVS instance on parallels can't connect to my Unity instance running on the mac.

    I read through the thread and saw that other people were having my same issue but none of the solutions seemed to help



    I am currently running unity 4.3.1 on the mac, and visual studio 2013 on windows 7 via parallels coherence mode. I also have resharper installed. UnityVs is 1.8.1

    I have successfully added the unityVS package to my test project. I see the unityVS menu item at the top of the unity UI.

    I can build the project from unity.

    In VS 2013. I see that UnityVS is installed. I can open the unityVS generated project. All dlls seem to be hooked up properly because resharper is not complaining about not finding namespaces.

    I can open files in VS by clicking on them in unity.

    I set my parallels networking to bridged mode, although it's using the default adapter.

    I set my build settings to use the mac standalone build for development. although, when I select Development Build for it, the development build checkbox is enabled for all the other platforms including the web player. maybe this is where I am making my mistake.



    Not sure what else to try.
     
  13. kolorbook

    kolorbook

    New Member

    Joined:
    Oct 19, 2013
    Messages:
    1
    Does this work with the WiiU devkit? I see AngryBots in your pic.. If so ill buy today

    Thanks
     
  14. jbevain

    jbevain

    Member

    Joined:
    Feb 22, 2012
    Messages:
    62
    Hi Dave,

    If you're running OSX Mavericks, UnityVS is currently hitting a bug in Unity's scripting engine which impacts the way we announce Unity Editors. We're working on a workaround for UnityVS 1.8.2 which should be released shortly. If your trial expired, don't hesitate to get in touch and we'll renew your trial license when we pushed the fix.

    Thanks!
     
  15. jbevain

    jbevain

    Member

    Joined:
    Feb 22, 2012
    Messages:
    62
    Hey,

    Last time we checked you couldn't build WiiU players with the script debugger enabled. Maybe it changed though. In any case, there's a UnityVS trial for you to check.

    Also, if it's very convenient to be able to debug your players with UnityVS, the main benefit is the fast workflow with the editor though. So even if you can't debug your player you could still benefit from the productivity increase :)
     
  16. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
    Hello,

    I just installed UnityVS trial, and as of now I like it very very much. I used to keep all my code in external assemblies, but UnityVS might finally be a way for me to accept Unity lose scripts :)

    I have a problem with UnityVS color schemes though. I use to code over a black background, and have set all my colors accordingly. Problem is, each time UnityVS starts up Visual Studio, it refactors some colors so that the line you're working with appears with bright text on a bright background. In short: unreadable. If I reimport my color scheme everything goes back to normal. But I have to do it each time I open Visual Studio with UnityVS, because UnityVS seems to reapply its color schemes (or at least that particularly annoying one). Any way to avoid this?

    Thanks, compliments for such a great thing
     
  17. ev3d

    ev3d

    Member

    Joined:
    Apr 19, 2013
    Messages:
    91
    does this allow you to debug in visual studio (installed on parallels) and use the mac version of unity?
     
  18. Arowx

    Arowx

    Member

    Joined:
    Nov 12, 2009
    Messages:
    2,474
    Does this work with the 'free' version of Visual Studio?
     
  19. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
    From their F.A.Q.: "Because Visual Studio Express does not support plugins, you can not use UnityVS with this version."
     
  20. jbevain

    jbevain

    Member

    Joined:
    Feb 22, 2012
    Messages:
    62
    Hm, that's weird: UnityVS doesn't do anything to color schemes. I'm not exactly sure what could trigger this. But UnityVS doesn't touch any color setting in VS (or any setting for that matters).

    Thanks, glad you find it useful!
     
  21. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
    I have no idea why, but it happened all the time the first day I was using UnityVS, then it stopped (probably thanks to a Unity restart). Anyway, everything's cool now, and I'll almost surely purchase a license in these days. I hated working with lose scripts, and thus created assemblies for every project. But with UnityVS, I'm finally ok :)
     
  22. ev3d

    ev3d

    Member

    Joined:
    Apr 19, 2013
    Messages:
    91
    my question seems to have been lost in the shuffle.. Does this allow you to debug in visual studio (installed on parallels) and use the mac version of unity?
     
  23. ZCG-Chris

    ZCG-Chris

    Member

    Joined:
    Mar 15, 2014
    Messages:
    1
    I'm still not able to get debugging working between my VMWare image and Unity on my Mac. I suspect it has something to do with Mavericks. I've hear other stories of something Apple did to break networking and maybe UDP in general. I am using Windows 8, VS 2013, Unity 4.3, and have tried all types of networking types including bridged. I don't get anything showing up in the dialog when I try attaching to Unity.
     
  24. cynic

    cynic

    New Member

    Joined:
    May 21, 2013
    Messages:
    142
    Slightly off-topic, but I also stumbled across this whole VS integration on the GDC schedule and I for one sure hope Unity doesn't forget its roots and finally surprises us Mac users with some fantastic code editing solution. The current MonoDevelop thingy is pure garbage.
     
  25. nhartung

    nhartung

    New Member

    Joined:
    Mar 3, 2014
    Messages:
    1
    I had a similar error dialog as you, but I can't be sure if there were caused by the same issue. Anyway, my issue was that my "External Script Editor Args" was still "$File$" (or something like that) by default. Once I removed that text I was able to open my files correctly in VS.

    You can navigate to this setting from Edit -> Preferences... -> External Tools
     
  26. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
    Hi again.

    I'm getting kind of annoyed (but I still love UnityVS) by a fact. In short, UnityVS tends to auto-overwrite Unity's preferences, and to set itself as the default editor each time Unity opens, even if you reverted to MonoDevelop. The especially annoying thing is that sometimes it does it even in the same project: I set the editor to MD, do some stuff (which also involves opening files in MD, so I'm sure I set things correctly), then when at a certain point (usually after an error happens) I double click a CS file in the Project Window suddenly Unity opens VS instead than MD, and the preferences appear to be changed.

    My workflow (mine and of many others I suppose) is to use VS for complex stuff, but revert to MD (actually, SublimeText in my case) for projects where I write just a few lines of code and need files to be opened immediately.

    Any fix for this? It doesn't appear in the known bugs list.
     
    Last edited: May 14, 2014
  27. Lostlogic

    Lostlogic

    Member

    Joined:
    Sep 6, 2009
    Messages:
    582
    Wow this looks really cool... will check it out next week when back working on my project. :)
     
  28. AndyLL

    AndyLL

    Member

    Joined:
    Aug 25, 2013
    Messages:
    63
    It's been a godsend for people like me that make a living in VS.

    Occasionally I have issues like disconnects from Unity and lockups but its not been to bad.
     
  29. jbevain

    jbevain

    Member

    Joined:
    Feb 22, 2012
    Messages:
    62
    In Unity, by going into UnityVS -> Configuration, you can uncheck “Open scripts with UnityVS”, and UnityVS won't overwrite the preference :)
     
  30. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
    Oh I thought I tried that, now I feel very stupid :D But why the double "preference"?
     
  31. jbevain

    jbevain

    Member

    Joined:
    Feb 22, 2012
    Messages:
    62
    That's because at the beginning we want to set ourselves in the Unity preferences without user input, to shorten the configuration.

    This way out of the box, if you import UnityVS, scripts would open directly with UnityVS, which would be the expected result. And then we added the configuration item for people with a more particular workflow.
     
  32. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
    Thanks for additional insight :)
     
  33. longroadhwy

    longroadhwy

    Member

    Joined:
    May 4, 2014
    Messages:
    82
    I saw on the Microsoft Blogs that this is now part of Microsoft.

    http://blogs.msdn.com/b/somasegar/a...ator-of-unityvs-plugin-for-visual-studio.aspx
     
  34. VodkaDestroyer

    VodkaDestroyer

    Member

    Joined:
    Mar 8, 2014
    Messages:
    2
    Guys, I have a problem. I just reinstall my system, and now i can't download Unity VS! I have licence, but there is no download section on UnityVS site... Can anyone send me UnityVS installer? Please... It's important for me...
     
  35. Izitmee

    Izitmee

    Member

    Joined:
    Jan 27, 2011
    Messages:
    2,418
  36. cj31387

    cj31387

    Member

    Joined:
    May 23, 2012
    Messages:
    75
    Does this support Unity Javascript Intellisense? If so how do I enable it , currently there are all kinds of syntax highlighted errors.
     
  37. Wild Factor

    Wild Factor

    Member

    Joined:
    Oct 11, 2010
    Messages:
    512
    I also have a freeze sometimes.
    When Visual studio is connected with Unity and debbuging, I got sometimes a domain error (can't remeber the exact error), and the connection is lost.
    Unity is just freezeed, and I need to restart Unity and visual. I've lost any modifications I've made on my Unity scene before the last save...

    I never had any freeze when I was debugging with mono. (And I will probably go back to it if there is not a solution)
     
  38. MichiealO

    MichiealO

    Member

    Joined:
    Jul 7, 2013
    Messages:
    6
    I have not seen UnityVS support UnityScript (the flavor of JavaScript that unity uses)... I know that the Intellisense in C# gets all of the Unity Classes, so that it is able to support it.. but, UnityScript is not a structured language. It's.... more "free form" than most languages.
     
  39. MichiealO

    MichiealO

    Member

    Joined:
    Jul 7, 2013
    Messages:
    6
    I had that happen when I first started using UnityVS... If I remember correctly, I had to reinstall the package & the asset. After that, I haven't had any other issues since. I have to say -- I really *LIKE* being able to use Visual Studio with Unity. Mono is a really crappy, out-dated compiler / environment. (heck, you can't even drag code around.... whoever thought that disabling that was a good idea needs to be forced to use mono for a while.)

    I wonder if the Unity team has ever considered using Sharp Development? That seemed like a good IDE (for being open sourced/free).
    Anyway, Try uninstalling the UnityVS, and reinstalling it. (also, you might want to try seeing if there is a newer version than the one that you have.)
     
  40. Wild Factor

    Wild Factor

    Member

    Joined:
    Oct 11, 2010
    Messages:
    512
    I will try reinstalling VS (I have the lastest version).

    I don't agree with the general opinion that mono is so bad.

    Well Mono do everything I want, and worked perfectly. I can navigate between file/class var/function with one shortcut.
    (I don't drag code, I copy paste them). When you know all the shortcuts, it's as productive as visual (and I've used visual for 8 years professionnaly). Code completion don't work better in visual for me either. And debuggin have the exact same flaw with uniotyVS than with mono (and the added crashs)
    In my opinion, if you don't have visual assist or resharper, mono is probably still more productive than visual studio.

    And I still need to switch between visual and unity, to force Unity to compil my code (I though this would be the biggest advantage of UnityVS)
     
  41. superpig

    superpig

    Insert bacon, receive bugfix Unity Technologies

    Joined:
    Jan 16, 2011
    Messages:
    2,595
    I believe the answer to that is 'not any more' - they dropped UnityScript support when MS bought them.
     
  42. Dustin Horne

    Dustin Horne

    Member

    Joined:
    Apr 4, 2013
    Messages:
    1,712
    SharpDevelop is ok. I've used it in the past for doing quick and dirty code conversions to get things from VB to C# as a rough start. I also tried using it with Unity just to see how it would work and it actually does, albeit very similar to Visual Studio Express. When you double click scripts it just opens the script and not the solution so you have to open the solution in Sharp Develop first. It's still a better editor than Mono Develop except for the lack of Debugging. :)
     
  43. Adam Romney

    Adam Romney

    New Member

    Joined:
    Nov 13, 2013
    Messages:
    1
    Anyone having issues with Visual Studio and .fbx files? When I double click an fbx, despite having Maya as my 'image application' VS tries to open the file.
     
  44. Wild Factor

    Wild Factor

    Member

    Joined:
    Oct 11, 2010
    Messages:
    512
  45. AndyLL

    AndyLL

    Member

    Joined:
    Aug 25, 2013
    Messages:
    63
    I love UnityVS however I've had nothing but problems with the new 1.91 release.

    On VS2012 when I updated I started getting 'Incompatible project' errors.

    I downloaded VS2013 and got the SetSite failed for package and on project load and "unrecognized guid format" trying to open files.

    I deleted the %LOCALAPPDATA%\Microsoft\VisualStudio\12.0 directory and it worked for a while.

    However last night when I exited VS2013 and reloaded I got the same error and I could not fix it.

    I 'repaired' vs2013 overnight and we'll see if that worked.
     
  46. ev3d

    ev3d

    Member

    Joined:
    Apr 19, 2013
    Messages:
    91
    i have the same issue..
     
  47. Dave_Voyles

    Dave_Voyles

    Member

    Joined:
    Feb 7, 2014
    Messages:
    18
    If you are looking for Visual Studio, shoot me an email.

    I'm an evangelist at Microsoft, working with startups and indie developers, so I can likely set you up with a copy of Visual Studio through our BizSpark program. We've also got tons of tutorials and content for Unity devs too. Here's one I did on using Prime[31]'s Azure Leaderboards.

    Here's some info on BizSpark.

    Perks of the program:

    • http://wootstudio.ca/startups/bizspark.aspx
    • Windows 8 / Windows Phone developer accounts
    • Visual Studio Ultimate 2013
    • Windows 8
    • Office 365
    • $150 / month Azure credits
    • Website hosting, virtual machines, databases, and mobile services
    • 90 Days of pluralsight + DigitalTutors training (Awesome for Unity)
    • Free marketing support with Microsoft
    • UnityVS, for debugging Unity games within Visual Studio
     
    Ryiah, Dustin Horne and R.Lindsay like this.