-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SourceLink to allow NuGet package debugging #1971
Comments
SourceLink currently advise to use the new symbol package format as part of enabling SourceLink. Now it may be time. But compared to the legacy symbol package that NHibernate currently publishes, it does not embed sources. (Well, this point should not be much an issue, since that is the point of SourceLink). And due to the way it is generated, this new symbol package cannot be generated along the legacy one in a single package generation: either it generates the legacy format, or the new format, but not both. This is a bit troublesome since the new format requires at least Visual Studio 2017 15.9 for being consumed, while the legacy one can be consumed by much older VS. I do not see why we should cease providing symbols for older VS, since NHibernate can be used with quite old ones. Maybe can we publish both symbol formats, but that will require a "double" package generation: one for the legacy format, one for the new one. |
Until I read your message in #1056 I didn't know that NHibernate publishes a (now legacy) symbol package.
And SourceLink itself (which is independent of the PDB format) works since Visual Studio 2017 15.3+ according to their readme. |
I was indeed not knowing about SourceLink and was confusing it with the new snupkg format recently introduced. I have edited my first comment for it to make more sense in regard to what you were actually writing about. |
SourceLink does indeed now suggest to use .snupkg files. But that was changed just 22 days ago. As can be seen in the diff, they suggested to embed the pdb in the main NuGet package before. Microsoft's open source library guidance still suggests to embed the pdb file directly in the main NuGet package (source). You can read the discussion about that here: dotnet/docs#9110
A pdb file directly embedded in the main NuGet package would allow everyone (at least everyone who can read portable pdbs, so VS 2015 Update 2 and later) to use the symbols without any additional VS configuration required. And with SourceLink anyone with VS 2017 15.3+ would be able to debug the source directly, again without additional configuration. Of course that pdb file should then be as small as possible (without embedded source). But since SourceLink requires no configuration, the only consumers that would loose source debugging would be the ones in versions older than 2017 15.3 |
I am fiddling a bit locally with this, and I think it cannot be done yet. Sourcelink currently implies to depend on a pre-release package, which forbids to release a non-pre-release package. |
I don't think that's true. Look at Json.NET, they reference Source Link but also released a non-pre-release package that contains the commit id, so has Source Link enabled. The Source Link dependency is not carried to the final package because of PrivateAssets="All". This is also mentioned in the Source Link readme:
|
Indeed, I was lacking |
Have you thought about adding SourceLink to NHiberante? That would make it easier to debug NHibernate in a project that references it.
As I see it, you'd only have to add the few things to the project file as explained in the readme of SourceLink. And you could then remove
RepositoryUrl
andRepositoryType
from NHibernate.props since they are set automatically by SourceLink.Related since the user will need to somehow get pdb files to allow SourceLink to work:
The text was updated successfully, but these errors were encountered: