Skip to content

Remove fallback for obtaining file-based program XML when SDK is too old#80291

Closed
RikkiGibson wants to merge 1 commit intodotnet:mainfrom
RikkiGibson:fix-vscode-csharp-8626
Closed

Remove fallback for obtaining file-based program XML when SDK is too old#80291
RikkiGibson wants to merge 1 commit intodotnet:mainfrom
RikkiGibson:fix-vscode-csharp-8626

Conversation

@RikkiGibson
Copy link
Member

@RikkiGibson RikkiGibson commented Sep 15, 2025

Related to dotnet/vscode-csharp#8626

Currently working on reproing the original user's environment, but, I suspect that since only old SDKs were present, and that the bug report actually reported there was no .NET SDK detected, that this fallback path got used, and somehow the setup of <ArtifactsPath> went wrong and resulted in artifacts being added to the user's source tree anyway.

<Project>
<PropertyGroup>
<IncludeProjectNameInArtifactsPaths>false</IncludeProjectNameInArtifactsPaths>
<ArtifactsPath>{SecurityElement.Escape(artifactsPath)}</ArtifactsPath>
Copy link
Member

@JoeRobich JoeRobich Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In older SDKs ArtifactsPath doesn't exist. Consider settings the base output paths instead.

<BaseIntermediateOutputPath>{SecurityElement.Escape(artifactsPath)}\obj\</BaseIntermediateOutputPath>
<BaseOutputPath>{SecurityElement.Escape(artifactsPath)}\bin\</BaseOutputPath>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mystery solved!

Contract.ThrowIfFalse(PathUtilities.IsAbsolute(documentFilePath));
var artifactsPath = GetArtifactsPath(documentFilePath);

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? "net$(BundledNETCoreAppTargetFrameworkVersion)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants