Add LocalPath property to RuntimeFile and ResourceAssembly for writing/reading deps.json#118034
Merged
elinor-fung merged 3 commits intodotnet:mainfrom Jul 25, 2025
Merged
Conversation
…g/reading deps.json
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a LocalPath property to both RuntimeFile and ResourceAssembly classes to support writing and reading additional path information in deps.json files. The LocalPath represents a path relative to the app/component root, while the existing Path property may be relative to different contexts like NuGet package roots.
Key changes:
- Extended constructors to accept optional
localPathparameter with backward compatibility - Updated JSON serialization/deserialization to handle the new
localPathproperty - Comprehensive test coverage for both portable and non-portable scenarios
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| RuntimeFile.cs | Added LocalPath property and constructor overload with documentation |
| ResourceAssembly.cs | Added LocalPath property and constructor overload with documentation |
| DependencyContextWriter.cs | Updated JSON writer to serialize LocalPath when present |
| DependencyContextJsonReader.cs | Updated JSON reader to deserialize LocalPath and create objects with new constructor |
| DependencyContextStrings.cs | Added LocalPathPropertyName constant |
| Microsoft.Extensions.DependencyModel.cs | Updated reference assembly with new public API surface |
| DependencyContextJsonWriterTests.cs | Refactored and expanded tests to cover LocalPath scenarios |
| DependencyContextJsonReaderTest.cs | Added tests for reading LocalPath from JSON |
src/libraries/Microsoft.Extensions.DependencyModel/src/ResourceAssembly.cs
Outdated
Show resolved
Hide resolved
Contributor
|
Tagging subscribers to this area: @dotnet/area-dependencymodel |
…eAssembly.cs Co-authored-by: Copilot <[email protected]>
AaronRobinsonMSFT
approved these changes
Jul 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #117682
cc @dotnet/appmodel @AaronRobinsonMSFT