1

I'm trying to debug C# project with VS Code. I like build system with "project.json" file and "dnu" utility. But "dnu build" produce only *.dll files and no *.pdb files. As result I see "Source code not available" in VS during debug session.

Is there any way to produce "*.pdb" or equivalent file with "dnu build"?

I'm using dnx with mono on Ubuntu and my project.json looks like following:

{
"configurations": {
    "Debug": {
        "compilationOptions": {
            "define": ["DEBUG", "TRACE"]
        }
    },
    "Release": {
        "compilationOptions": {
            "define": ["RELEASE", "TRACE"],
            "optimize": true
        }
    }
},
"frameworks": {
    "dnx451": {
        "frameworkAssemblies": {
            "System": "",
            "System.Runtime": ""
        }
    }
},
"dependencies": {
    "Newtonsoft.Json": "8.0",
    "Unity": "4.0"
},
"compile": "*/**/*.cs"
}

P.S. Any other ideas about how to debug assemblies produced by "dnu build" with VS Code are welcome.

Dmitry
  • 201
  • 3
  • 5
  • As in https://code.visualstudio.com/Docs/runtimes/ASPnet5 it seems not possible in VS Code. The article was updated a week ago. – Thomas Dec 26 '15 at 09:07
  • ps: You are doing a hardcore combination. DNX on Mono on Linux with Debugging (Portable PDB) in VSCode including Unity library. Everything, except Newtonsoft.Json is in a stage of Beta (in context ;)) – Thomas Dec 26 '15 at 09:09
  • Added some more info about subj in my blog http://peleshenko.net/2016/01/11/dnx-netcore-aspnet-vnext/ – Dmitry Jan 11 '16 at 18:55

1 Answers1

1

Looks like *.pdb are created on dnu build automatically on windows. I tried on Ubuntu and no *.pdb was created as you've seen.

However, I saw this, and confirmed that setting DNX_BUILD_PORTABLE_PDB to true;

export DNX_BUILD_PORTABLE_PDB=true

and then running dnu build results in the *.pdb being generated.

Stafford Williams
  • 9,696
  • 8
  • 50
  • 101
  • Thank you very much that helped. But looks like Thomas (see comments to my question) was right. Visual Studio Code currently is not supporting debugging of dnx assemblies. That's why this option is disabled by default. It did't matced code with binary even after I've created *.pdb. – Dmitry Dec 28 '15 at 14:29