Skip to content
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

Set intermediate path sooner #74229

Merged
merged 6 commits into from
Jul 2, 2024
Merged

Conversation

ryzngard
Copy link
Contributor

@ryzngard ryzngard commented Jul 1, 2024

Pulled from #70913 (thanks @davidwengier!)

Razor uses the intermediate path for project key. Now that we're removing the file system from being involved in communicating project data, we need to make sure we're communicating the right data.

This fixes issues found in dotnet/vscode-csharp#7273 and will unblock that insertion

@ryzngard ryzngard requested a review from a team as a code owner July 1, 2024 23:33
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 1, 2024
@@ -160,6 +160,7 @@ public async Task SetBuildSystemPropertiesAsync(IReadOnlyDictionary<string, stri
switch (name)
{
case "AssemblyName": _project.AssemblyName = value; break;
case "IntermediateAssembly": _project.CompilationOutputAssemblyFilePath = GetFullyQualifiedPath(valueOrNull); break;
Copy link
Contributor

Choose a reason for hiding this comment

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

GetFullyQualifiedPath has a bug, where it won't work for a relative path, because it does Path.Combine(_project.FilePath, value), but _project.FilePath is the full path to the actual project file (ie, .csproj file). When value is an absolute path, then that will be returned and all will be good, but the intermediate output path is a relative path, so we'd end up with CompilationOutputAssemblyFilePath being something like C:\Goo\Bar.csproj\obj\Debug\net8.0 which is not correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see, that was your comment about why it wasn't completely broken. The paths are coming in as absolute path so Path.Combine is just using the second parameter. I think what I did will fix the issue

@ryzngard ryzngard enabled auto-merge (squash) July 2, 2024 05:24
@ryzngard ryzngard merged commit 863962d into dotnet:main Jul 2, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jul 2, 2024
@ryzngard ryzngard deleted the intermediate_path_fix branch July 2, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants