Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Loading symbols for a managed DLL doesn't work in Visual Studio with Unity 5.6.1f1

Discussion in 'Windows' started by pvaananen, Jun 13, 2017.

  1. pvaananen

    pvaananen

    Joined:
    Jun 13, 2017
    Posts:
    1
    I have a managed DLL compiled against the .NET framework version 3.5. Let's call it plugin.dll.
    In my Unity project I have placed it in Assets\Plugins\Win64 and I can use it just fine with the VS project generated by Unity.
    I can attach a debugger to the running Unity instance and place breakpoints in all the C# code that belongs to the Unity project, but the symbols for the managed DLL just won't load.

    So, when debugging the project by clicking "Attach to Unity" I can see plugin.dll in the Modules window but the symbols for it don't get loaded.

    I have tried the following things:
    • Turning off Just My Code
    • Placing the generated plugin.pdb file in Assets\Plugins\Win64 next to plugin.dll
    • Adding my VS build directory (with all .pdb's) to Visual Studio's Symbol locations list

    I'm sure that the .pdb is for the correct version of the library.
    If I right click on plugin.dll in the Modules window and choose "Symbol Load information..." no window opens, which is surprising.
    If I choose "Load Symbols" from the menu instead, then a modal window with title "Downloading symbols" that says "plugin.dll" gets shown for a few seconds but nothing happens:



    I can see plugin.pdb appearing in the symbol cache directory though, so VS seems to find the file.

    Specs:
    Windows 10 Enterprise 64-bit
    Microsoft Visual Studio 2015, Version 14.0.25431.01 Update 3, .NET 4.7.02046
    Unity 5.6.1f1 Personal Edition
     
    Last edited: Jun 14, 2017
    mixwrx likes this.
  2. Johan_Gustavsson_Saab

    Johan_Gustavsson_Saab

    Joined:
    May 31, 2017
    Posts:
    1
    I'm having the exakt same issue, running latest VS (2017 15.5.2) and Unity (2017.3). Symbols will not load, selecting load symbols gives no error message but nothing happens.
     
  3. redwyre

    redwyre

    Joined:
    Oct 14, 2018
    Posts:
    29
    Still a problem in Visual Studio 15.9.6, Visual Studio Tools for Unity 3.9.0.3, and Unity 2018.2.20f1
     
  4. cristian_cristea

    cristian_cristea

    Joined:
    Nov 27, 2017
    Posts:
    5
    Having the same problem also. Have you guys solved it somehow?

    Thanks
     
  5. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    604
    Any update on this one guys. Having the same problem.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Did you build the DLL yourself? DId you make sure that the debug symbol format is "portable PDB", as opposed to 'Windows PDB"?
     
    Maeslezo and 8bitRick like this.
  7. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    604
    Yes. It's my DLL.
    Build settings in VS is set as "debugging info = Pdb-only".
    There is no "Windows PDB" option.
    But there is a "Portable option". I'll try that.
     
  8. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    604
    That... my friend, totally WORKED!
    You were able to provide an info nobody else could have.
    Thank you very much.

    Debug info setting for pre-compiled DLL in VS project settings must be "PORTABLE".

    As a side note: Exsiting (old) MDB files must be deleted for it to work correctly. Unity still take those old MDBs in effect if they exist.