-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Improve virtualproject support for older .NET SDKs #80324
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
Conversation
Do not rely on TFMs and MSBuild properties that do not exist in older SDKs.
| <Project> | ||
| <PropertyGroup> | ||
| <IncludeProjectNameInArtifactsPaths>false</IncludeProjectNameInArtifactsPaths> | ||
| <ArtifactsPath>{SecurityElement.Escape(artifactsPath)}</ArtifactsPath> |
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.
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)"; |
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.
BundledNETCoreAppTargetFrameworkVersion is part of each SDK. For .NET 10 it is 10.0
|
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. |
* 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 ...
* 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 ...

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