dotnet cli run referencing local libraries in addition to referencing…#49216
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for referencing local libraries in dotnet CLI commands through a new "library" directive when building virtual projects.
- Introduces filtering and handling for library directives in project file generation.
- Adds a new Library class with parsing logic for validating the library path.
- Updates the XML output to include library references.
Comments suppressed due to low confidence (1)
src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs:617
- [nitpick] Consider reviewing and standardizing the indentation in the multi-line string literals to ensure that the resulting XML is formatted as intended.
writer.WriteLine("""
<ItemGroup>
""");
|
@dotnet-policy-service agree [company="Currently unemployed"] Yes, I'm happy to grant y'all copyright in respect of this PR |
|
@dotnet-policy-service agree |
|
OK, so test.sh seems to run and run - still gaining understanding of test-tech in repo. |
|
OK, copilot (via the web UI) offers advice if I paste in a dumped .csproj file. I've been round and round in circles and can't get past I've tried everything it suggested: https://pastebinrichtext.com/paste/f5afd97c-0a54-490e-9218-037a8a6220a1 Some things being reported as errors make no sense. No, I'm not including GreekTests twice. I've added a temp dump of the in-memory .csproj file And a recap on my proximate cause: If if only have |
|
I would love this to land.... |
|
Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label. |

… nuget packages
I'm simulating google's in-house monorepo and have made a rudimentary build system that doesn't rely on .sln or .csproj files. I've Java, Rust, Go and Kotlin in the trunk, and in a branch that I'll merge in when I can C# components and applications. Here's that running a hacky test-runner - https://github.com/paul-hammant/google-monorepo-sim/blob/dot_net_app_and_components_wip/csharptests/components/greek/GreekTests.cs
From that source:
The Shouldly package from nuget as the preview-4 supports
And a library from a relative (prior) build step.
This works for me in that solution. At least, I've other problems from juggling multiple versions of dotnet, but both of those acquisitions load OK.
I think proper tests go into test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs or
test/dotnet.Tests/CommandTests/Run/RunFileTests.cs or both. I'll add those to the PR unless the team says "never happening"