From 2b11b82d0df2c46222aef0ed51bca91a40536c48 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Wed, 4 Mar 2020 15:33:42 +0100 Subject: [PATCH 1/4] Re-added SourceLink support Getting this to work was quite a challenge. I started out with the minimal example described at https://blog.jetbrains.com/dotnet/2020/02/03/sourcelink-consuming-apis-nuget-dependent-code/ and the guidance at https://github.com/dotnet/sourcelink/. This creates a .snupkg (containing symbols) next to the .nupkg, both of which need to be uploaded to nuget.org. At the moment, nuget.org is the only package registry that supports this. It does not work for local feeds, AppVeyor or any other registry (https://stackoverflow.com/questions/54211644/publish-snupkg-symbol-package-to-private-feed-in-vsts). And requires an internet connection during debug, as there is currently no command to fetch all symbols upfront. After uploading to NuGet.org, stepping into sources did not work on my machine (VS Debug settings: Enable Source Link support checked and Enable Just My Code unchecked). Then I enabled the NuGet.org Symbol Server, which started downloading symbols for all .NET Core packages during my debug session, which took forever so I aborted. It turned out that in the past, SourceLink worked by including the PDB in .nupkg, but [guidance was changed](https://github.com/dotnet/sourcelink/issues/255) to use the nuget.org symbol server instead. I installed the sourcelink global tool (https://www.meziantou.net/how-to-debug-nuget-packages-using-sourcelink.htm) and ran it with the `test` switch, which failed and reported that AssemblyInfo.cs could not be found. This sounds reasonable, because the file is auto-generated by the .NET Core build chain. As discussed [here](https://github.com/dotnet/sdk/issues/2679), symbol server support is not working very well for numerous reasons. So I reverted to [including the PDB](https://www.hanselman.com/blog/ExploringNETCoresSourceLinkSteppingIntoTheSourceCodeOfNuGetPackagesYouDontOwn.aspx) instead of using symbol server (using `$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb`) and setup a local nuget feed. This worked, but only because the DLL and PDB contained hardcoded paths to my sources on disk. There was no prompt to download sources from GitHub. Renaming the JADNC directory or adding `true` (which changes paths like `c:\source\repos\JsonApiDotNetCore\...` to `\_\JsonApiDotNetCore\...`) broke the experience. I had to manually browse to the PDB file on disk (via Modules, Load Symbols) to be able to step into sources again. The only way I got this working without intervention was to embed the PDB inside the DLL, using `embedded`. Note you need to push first, so that the commit hash stored in .nupkg exists on GitHub. And have Enable Just My Code unchecked in VS Debug settings. Other changes in this PR: - Fixed package tags (must be single words, because tags are space-delimited in .nuspec) - Added description (shown in VS Package Manager UI) - Removed RepositoryType and RepositoryUrl, so they are calculated (and use the URL of my fork) --- src/JsonApiDotNetCore/JsonApiDotNetCore.csproj | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj index 3faf239f51..6622ae7ed8 100644 --- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj +++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj @@ -1,23 +1,19 @@ - + 4.0.0 $(NetCoreAppVersion) - JsonApiDotNetCore - JsonApiDotNetCore - 8.0 true - jsonapi;dotnet core;emberjs;ember + jsonapi;json:api;dotnet;core + A framework for building json:api compliant web APIs. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy. https://github.com/json-api-dotnet/JsonApiDotNetCore MIT false - git - https://github.com/json-api-dotnet/JsonApiDotNetCore true true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + embedded @@ -26,6 +22,7 @@ + @@ -45,4 +42,4 @@ - + \ No newline at end of file From da32eaeec710714dcaae06e52199971bb73e6778 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Thu, 5 Mar 2020 11:46:59 +0100 Subject: [PATCH 2/4] Removed unneeded folder in project file --- src/JsonApiDotNetCore/JsonApiDotNetCore.csproj | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj index 6622ae7ed8..e48253703b 100644 --- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj +++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj @@ -39,7 +39,4 @@ - - - - \ No newline at end of file + From 3fa2918af67cebbd1623f58b33587d60de280f6b Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Thu, 5 Mar 2020 13:52:33 +0100 Subject: [PATCH 3/4] Empty commit to restart TravisCI From 4c258e0d33ee539b2245ae60342e6f8397ab37ba Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Thu, 5 Mar 2020 14:06:35 +0100 Subject: [PATCH 4/4] Empty commit to restart TravisCI