Improve virtualproject support for older .NET SDKs#80324
Merged
Conversation
Do not rely on TFMs and MSBuild properties that do not exist in older SDKs.
CyrusNajmabadi
approved these changes
Sep 17, 2025
JoeRobich
commented
Sep 17, 2025
| <Project> | ||
| <PropertyGroup> | ||
| <IncludeProjectNameInArtifactsPaths>false</IncludeProjectNameInArtifactsPaths> | ||
| <ArtifactsPath>{SecurityElement.Escape(artifactsPath)}</ArtifactsPath> |
Member
Author
There was a problem hiding this comment.
ArtifactsPath was added in .NET 8 but our BuildHost supports back to .NET 6.
| var artifactsPath = GetArtifactsPath(documentFilePath); | ||
|
|
||
| var targetFramework = Environment.GetEnvironmentVariable("DOTNET_RUN_FILE_TFM") ?? "net10.0"; | ||
| var targetFramework = Environment.GetEnvironmentVariable("DOTNET_RUN_FILE_TFM") ?? "net$(BundledNETCoreAppTargetFrameworkVersion)"; |
Member
Author
There was a problem hiding this comment.
BundledNETCoreAppTargetFrameworkVersion is part of each SDK. For .NET 10 it is 10.0
jasonmalinowski
approved these changes
Sep 17, 2025
Member
|
This looks good and I'm ok with closing my PR #80291. I'm going to try to manual test this solution today to get some sense of whether it will fix the user's scenario. |
Member
RikkiGibson
approved these changes
Sep 18, 2025
333fred
added a commit
that referenced
this pull request
Sep 18, 2025
* upstream/main: (206 commits) Remove bogus xlf tag (#80357) Fix missing type argument checks Add tests Use dotnet run file for generating compiler code (#80248) Only restore based on assets file changes if the actual content changed (#80341) make expressionbody analyzer use semanticspananalysis (#80339) [EnC] Use ignoreAssemblyKey: false to resolve symbol keys (#80342) Properly populate ExportedType metadata table in presence of extension block. (#80311) Propagate `params` to lambdas and local functions (#79880) Change 17.15 to VS 2026 preview. (#80325) Improve virtualproject support for older .NET SDKs (#80324) Update dependencies from https://github.com/dotnet/dotnet build 283666 (#80344) Update dependencies from https://github.com/dotnet/arcade build 20250917.6 (#80343) Simplifying Fix tests Fix tests Fix introduce variable placement in top level statements move to immutable types in signature help move to immutable types in signature help Fix check ...
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Sep 18, 2025
* upstream/main: (31 commits) Remove bogus xlf tag (dotnet#80357) Fix missing type argument checks Add tests Use dotnet run file for generating compiler code (dotnet#80248) Only restore based on assets file changes if the actual content changed (dotnet#80341) make expressionbody analyzer use semanticspananalysis (dotnet#80339) [EnC] Use ignoreAssemblyKey: false to resolve symbol keys (dotnet#80342) Properly populate ExportedType metadata table in presence of extension block. (dotnet#80311) Propagate `params` to lambdas and local functions (dotnet#79880) Change 17.15 to VS 2026 preview. (dotnet#80325) Improve virtualproject support for older .NET SDKs (dotnet#80324) Update dependencies from https://github.com/dotnet/dotnet build 283666 (dotnet#80344) Update dependencies from https://github.com/dotnet/arcade build 20250917.6 (dotnet#80343) Simplifying Fix tests Fix tests Fix introduce variable placement in top level statements move to immutable types in signature help move to immutable types in signature help Fix check ...
This was referenced Sep 19, 2025
This was referenced Sep 25, 2025
This was referenced Oct 27, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Related to dotnet/vscode-csharp#8626
Do not rely on TFMs and MSBuild properties that do not exist in older SDKs.