Search code examples
visual-studiounity-game-enginemonomanaged

Unity Error "Visual Studio Tools: failed to convert debug symbols, no pdb2mdb"


TL; DR

Why would Unity think there is no pdb2mdb when using Visual Studio Tools for Unity (VSTU)?

Background

I import my Unity scripts as managed plugins (DLLS) from Visual Studio. That is, when I build my code in VS, I export the generated .dll and .pdb file to Unity, and the Visual Studio Tools for Unity (VSTU) extension handles converting the .pdb's to .mdb's so I can debug. Recently however, when I build my DLLs in VS and export them to Unity, the Unity console displays the following error:

Visual Studio Tools: failed to convert debug symbols, no pdb2mdb

pdb2mdb is the program within VSTU that converts .pdb to .mdb, and I have no idea why its supposedly missing all of a sudden. I've tried cleaning/rebuilding my VS solution, restarting VS and Unity, and repairing my VS installation, all without success. Even stranger, this behavior is happening on two different computers (albeit with all the same relevant software versions), which makes me nervous that the issue is somehow specific to my project. All the information that I've been able to find so far is several years old and has not helped.

My development environment:

  • Windows 10
  • Unity 2017.2.0f3
  • Visual Studio 2017 15.5.0
  • VSTU 3.5.0.2

Solution

  • Same thing happened to me after upgrading to Visual Studio 2017 15.5.0. Unfortunately there is no easy way to downgrade Visual Studio, so the best thing would be to wait for a fix.

    EDIT:

    Solution: Downgrade your visual studio to 15.0.

    1. Uninstall version 15.5.0 by running visual studio installer and uninstalling any Visual Studio product.
    2. Using you Microsoft account, login to http://my.visualstudio.com.
    3. Download the installation of Visual Studio 15.0 and install it. Don't forget to check Visual Studio Tools for Unity.
    4. Test and verify the issue is solved.

    EDIT 2:

    Sorry that it comes in phases, it's because I kept investigating it. Once you have Visual Studio 2017 15.0 installed (instructions above), you can now upgrade to 15.2 (which is much more stable), doing the following:

    1. Download the manifest file for 15.2 (here) and put in C:\VS2017.
    2. Download Visual Studio Community installer (here) and put in the same directory.
    3. Open command line window (as Administrator), change directory to C:\VS2017, and type: vs_community.exe --installChannelUri "file:///C:/VS2017/ChannelManifest.json" --channelUri "https://aka.ms/vs/15/release/channel"
    4. You can now upgrade to 15.2!