Thoth.Json.Net icon indicating copy to clipboard operation
Thoth.Json.Net copied to clipboard

Add SourceLink2 support

Open Luiz-Monad opened this issue 5 years ago • 3 comments

Adding support for DotNet Core debugging by using portable PDBs. It's all driven by paket itself !

I'll be waiting for SourceLink v2 to stabilize (actually I'm already using it), it's pretty cool and way better than the old symbol server that where a pain the sockets to configure in the Visual Studio. The only issue I found is that the C# projects generate ".snupkg", F# projects instead do it the older way, that is, putting the "pdb" inside the normal "nupkg" ( I think its something with their msbuild ). SnuPkg uses the v3 of nuget protocol and semver 2.0.

I'm using this settings on my vscode, in case it's useful for someone else.

"justMyCode": false,
"suppressJITOptimizations": true,
"console": "internalConsole",
"internalConsoleOptions": "openOnSessionStart",
"symbolOptions": {
    "searchPaths": [
        "http://localhost:5000",
        "https://nuget.smbsrc.net/"
    ],
    // "searchMicrosoftSymbolServer": true,
    "cachePath": "C:/Users/Luiz/.symcache",
    "moduleFilter": {
        "mode": "loadAllButExcluded",
        "excludedModules": [ 
            "FSharp.Core.dll",
            "netstandard.dll",  ... others.... omitted
        ]                }            },
"sourceLinkOptions": {
    //"https://nuget.org/*": { "enabled": true },
    "*": { "enabled": true }
}  

Useful resources used to implement it:

https://www.hanselman.com/blog/ExploringNETCoresSourceLinkSteppingIntoTheSourceCodeOfNuGetPackagesYouDontOwn.aspx

https://carlos.mendible.com/2018/08/25/adding-sourcelink-to-your-net-core-library/

https://github.com/dotnet/sourcelink

https://github.com/ctaggart/SourceLink/wiki/Paket

Luiz-Monad avatar Jun 22 '19 19:06 Luiz-Monad

Hello @Byte-666 ,

thank you for creating the PR :)

As mentioned on the Gitter channel, I reworked the process to package the library.

Could you please re-base the master on master and fix the breaking changes?

I'll be waiting for SourceLink v2 to stabilize

Do you mean, that we should wait of v2 before shipping it in the package? Or can we ship it as it is now?

MangelMaxime avatar Jun 24 '19 10:06 MangelMaxime

Hello @Byte-666 ,

thank you for creating the PR :)

As mentioned on the Gitter channel, I reworked the process to package the library.

Could you please re-base the master on master and fix the breaking changes?

I'll be waiting for SourceLink v2 to stabilize

Do you mean, that we should wait of v2 before shipping it in the package? Or can we ship it as it is now?

I think we can ship it now, it's just a tiny extra pdb in the nuget file, even if they change the way we publish it to the nuget, it shouldn't affect the library users. We can easily upgrade paket when they fix it.

The change I'm awaiting for is when the paket start using the snupkg in the paket pack instead of nupkg. But FSharp libraries are usually so small it doesn't really matter for the user.

Luiz-Monad avatar Jun 24 '19 21:06 Luiz-Monad

The change I'm awaiting for is when the paket start using the snupkg in the paket pack instead of nupkg.

Note that we don't use anymore paket pack but dotnet pack.

MangelMaxime avatar Jun 25 '19 06:06 MangelMaxime