-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Allow MSBuildWorkspace to open file-based apps #84139
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
Merged
jjonescz
merged 65 commits into
dotnet:main
from
jjonescz:78887-sprint-MSBuildWorkspace
Jul 30, 2026
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
946f90f
Allow MSBuildWorkspace to open file-based apps
jjonescz a0e4f7a
Add RemoteProjectInstance
jjonescz 715a38f
Support `#:ref`s
jjonescz c850439
Merge branch 'main' into 78887-sprint-MSBuildWorkspace
jjonescz 8a8efd0
Fixup use of ImmutableArray
jjonescz daf0e3a
Update to fix a leak
jjonescz 70c8202
Remove unnecessary items
jjonescz ad8d824
Use VirtualProjectBuilder in FileBasedProgramsProjectSystem
jjonescz 4f7e092
Test `#:ref` in LSP
jjonescz 9d7ceee
Fixup tfm condition
jjonescz fb1d7eb
Merge branch 'main' into 78887-sprint-MSBuildWorkspace
jjonescz 9fc0b90
Improve tests
jjonescz b66509c
Fixup net472
jjonescz 6d97213
Improve global.json in tests
jjonescz 52f1c2e
Test diagnostics
jjonescz b0cfe02
Remove CSharp dependency
jjonescz c4224f3
Move the whole builder to the service
jjonescz 9a2c671
Improve code ordering
jjonescz a8cd5ba
Promote to workspace service
jjonescz 95f50a3
Implement more BuildService APIs
jjonescz dba38e8
Improve BuildService implementation
jjonescz 19a524a
Remove run-api usage
jjonescz 3da4bd8
Extract TFM
jjonescz b62c59c
Share global build properties
jjonescz c31639f
Bump SDK to 10.0.301
jjonescz 4b3e00d
Remove custom `global.json`s from tests
jjonescz a7b8321
Merge branch 'main' into 78887-sprint-MSBuildWorkspace
jjonescz 7a3b860
Fix SourceRoot test
tmat f9d95e8
Remove unnecessary `using`
jjonescz 1a104e8
Support extensionless file-based apps
jjonescz 68bd559
Remove copied virtual project helpers
jjonescz 4900670
Disable MSBuild server temporarily
jjonescz 57ca53e
Fixup implementation of GetDiscoveryCacheRootDirectory
jjonescz 1ad218f
Ensure fuzz repro is up-to-date
jjonescz 06b57f1
Move the source package to Workspaces layer
jjonescz 8cb6ea2
Prefer NetCore for file-based apps
jjonescz 97a1252
Propagate cancellation token
jjonescz 87968dd
Use `GetAwaiter().GetResult()`
jjonescz b5ca6df
Avoid loading non-existent DLLs in a test
jjonescz 27c8141
Improve assert in a test
jjonescz 8fef535
Merge branch 'main' into 78887-sprint-MSBuildWorkspace
jjonescz f04f656
Use physical file path in project map
jjonescz 5c8f512
Simplify physical/virtual path split
jjonescz 18522a2
Pass options to XmlReader
jjonescz aee4b35
Merge branch 'main' into 78887-sprint-MSBuildWorkspace
jjonescz f084b1f
Dispose remote project instances
jjonescz 1fc2f1d
Use BundledNETCoreAppTargetFrameworkVersion
jjonescz 84abddb
Share DeferDeleteCacheDirectory call
jjonescz 06488a7
Improve how default TFM is specified
jjonescz be34fb2
Improve code
jjonescz b27925e
Avoid hang in self-referencing test
jjonescz 3ade14a
Improve compilation references in a test
jjonescz 75a1f82
Move ProjectRootElement cache outside VirtualProjectBuilder
jjonescz ae74a50
Handle global properties
jjonescz 29f58c4
Add comments
jjonescz 74f01cf
Ensure MSBuildUtilities are still included
jjonescz 51442eb
Get all item metadata values at once
jjonescz 2d3aeaf
Check disposal like the other entrypoints
jjonescz 54cf60f
Make IBuildService async
jjonescz 6bc96ff
Clarify RPC API
jjonescz 9943ae8
Add `ConfigureAwait(false)`
jjonescz 6dc5b9e
Narrow data guard hold
jjonescz 371a034
Test AssociateFileExtensionWithLanguage
jjonescz c9b40e0
Document file-based app support
jjonescz d7cfdbb
Update to a merged commit hash
jjonescz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
157 changes: 114 additions & 43 deletions
157
....LanguageServer.UnitTests/MiscellaneousFiles/FileBasedProgramsEntryPointDiscoveryTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
171 changes: 0 additions & 171 deletions
171
...eServer/Microsoft.CodeAnalysis.LanguageServer.UnitTests/VirtualProjectXmlProviderTests.cs
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 I've added only basic support for
#:ref.#:ref-><ProjectReference/>- this comes for free from the updatedVirtualProjectBuilderthat is source-synced here from dotnet/sdk repo.<ProjectReference/>s which point to virtual project - small changes only, e.g., insrc\Workspaces\MSBuild\Core\MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs.This results in the project reference being loaded as metadata reference (not source reference), i.e., equivalent to having a reference to a project that's not part of the solution.
Better than nothing, but a follow-up PR (since it's orthogonal to this PR and would require more code changed) should probably improve on this to discover these projects and add them to the virtual solution.
Similarly, completion, classification, etc. is orthogonal as well and already being worked on in PR #83985.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. Do you think discovery should parse directives when we have a positive entry point match and walk the
#:refs? (not for this PR obviously.) That feels viable since we would only pay the cost after identifying the#!.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, some component should probably take the loaded Project instance and add all its
ProjectReferenceitems automatically to the solution. (It can only limit that toProjectReferenceitems that correspond to#:refdirectives, those can be recognized via a special metadata item which the virtual project emits for them.#:projectdirectives refer to normal projects, so users already have a way to make those part of the solution.) This component can be the discovery if it has access to the Project instance, or it could be just the ProjectSystem or something.