Skip to content
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

PackagePathResolver.GetPackageDirectoryName should be virtual #5700

Closed
albahari opened this issue Aug 2, 2017 · 3 comments
Closed

PackagePathResolver.GetPackageDirectoryName should be virtual #5700

albahari opened this issue Aug 2, 2017 · 3 comments
Assignees
Labels
help wanted Considered good issues for community contributions. Triage:NeedsTriageDiscussion Type:DCR Design Change Request
Milestone

Comments

@albahari
Copy link

albahari commented Aug 2, 2017

I am the author of LINQPad - a popular code scratchpad which has integrated support for NuGet. I'm in the process of upgrading LINQPad's NuGet support from NuGet 3.x to NuGet 4.x.

I've run into a blocking issue: the methods in PackagePathResolver used to be virtual in NuGet 3.x and they are non-virtual in NuGet 4.x, so my subclassed PackagePathResolver no longer compiles. I need PackagePathResolver.GetPackageDirectoryName to be virtual so that I can override this method to encode the name when it exceeds a certain length. This is an essential workaround to avoid "path too long" errors. These errors occur more frequently in LINQPad than VS, because a long root directory is required (this is a a consequence of LINQPad having a snippet-based architecture rather than a project-based architecture).

Let me know if I should submit a pull request. It's simply a matter of inserting "virtual" before that method declaration - and LINQPad will then enjoy NuGet 4.x integration :)

@rrelyea rrelyea added this to the 4.4 milestone Aug 2, 2017
@rrelyea rrelyea added help wanted Considered good issues for community contributions. Triage:NeedsTriageDiscussion Type:DCR Design Change Request labels Aug 2, 2017
@rrelyea
Copy link
Contributor

rrelyea commented Aug 2, 2017

@emgarten - can you please advise or farm out to a more appropriate team member here.
I think we'd consider a PR for this (or alternate solutions), once we verify that aren't complications, for 4.4.

@emgarten
Copy link
Member

emgarten commented Aug 2, 2017

There are two path resolvers, one for v2 and one for v3 folder formats.

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/PackagePathResolver.cs

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/VersionFolderPathResolver.cs

I think they should both be made virtual as part of this.

@emgarten
Copy link
Member

emgarten commented Aug 2, 2017

@albahari a PR for this would be great. Otherwise @rohit21agrawal would you take a look at this for 4.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Considered good issues for community contributions. Triage:NeedsTriageDiscussion Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

4 participants