Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ internal static string MakeVirtualProjectContent_DirectFallback(string documentF
Contract.ThrowIfFalse(PathUtilities.IsAbsolute(documentFilePath));
var artifactsPath = GetArtifactsPath(documentFilePath);

var targetFramework = Environment.GetEnvironmentVariable("DOTNET_RUN_FILE_TFM") ?? "net10.0";
var targetFramework = Environment.GetEnvironmentVariable("DOTNET_RUN_FILE_TFM") ?? "net$(BundledNETCoreAppTargetFrameworkVersion)";
Copy link
Member Author

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


var virtualProjectXml = $"""
<Project>
<PropertyGroup>
<IncludeProjectNameInArtifactsPaths>false</IncludeProjectNameInArtifactsPaths>
<ArtifactsPath>{SecurityElement.Escape(artifactsPath)}</ArtifactsPath>
Copy link
Member Author

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.

<BaseIntermediateOutputPath>{SecurityElement.Escape(artifactsPath)}\obj\</BaseIntermediateOutputPath>
<BaseOutputPath>{SecurityElement.Escape(artifactsPath)}\bin\</BaseOutputPath>
</PropertyGroup>
<!-- We need to explicitly import Sdk props/targets so we can override the targets below. -->
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
Expand Down
Loading