ramondeklein / nwebdav

.NET implementation of the WebDAV protocol
MIT License
155 stars 42 forks source link

Implement SourceLink for better debugging experience #34

Closed ramondeklein closed 6 years ago

ramondeklein commented 6 years ago

SourceLink can be added, so users can debug their own stores much more easy. More info on https://github.com/dotnet/sourcelink

ramondeklein commented 6 years ago

It took some commits (due to casing issues), but SourceLink seems to work from v0.1.31.

StefH commented 6 years ago

Can you explain shortly what needed to do?

ramondeklein commented 6 years ago

Make sure you have the latest Visual Studio 2017 and latest .NET Core v2.1.301 and the latest NWebDAV version. Then you should be able to step into the code. For more information, check the documentation of SourceLink.

StefH commented 6 years ago

I meant what changes you needed to do to get this working / building.

ramondeklein commented 6 years ago

Add the following sections to your .csproj fiile:

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  <DebugType>portable</DebugType>
  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
  <GenerateDocumentationFile>true</GenerateDocumentationFile>
  <PublishRepositoryUrl>true</PublishRepositoryUrl>
  <EmbedUntrackedSources>true</EmbedUntrackedSources>
  <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All" />
</ItemGroup>

You need a recent version of NuGet, build with .NET core v2.1.301 and you should be ready to go.

I had some issues with improper casing of directories. GitHub is case-sensitive, but the WIndows filesystem is not. Also make sure you have the proper version of Microsoft.SourceLink.GitHub. The latest version didn't work for me, but 1.0.0-beta-62925-02 did.

And of course, you need to make sure the commits are on GitHub en you have pushed your package to NuGet.