Skip to content

Conversation

chsienki
Copy link
Member

@chsienki chsienki commented May 5, 2025

  1. Ensure we redirect the entire closure of razor dependencies in VSCode.
  2. When asked to load any of the razor closure of assemblies, load them all at once.

This fixes the FileNotFound exceptions in VSCode by ensuring the right versions of razor are all mapped and loaded together.

This is ultimately an ugly hack on top of a pile of already ugly hacks, but I'm planning on changing the way this works by using a custom ALC tracked here: #76868 so this should be very short lived and just enough to unblock VSCode for now.

Whitespace off makes the diff much clearer.

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 5, 2025
@chsienki chsienki marked this pull request as ready for review May 5, 2025 22:21
@chsienki chsienki requested a review from a team as a code owner May 5, 2025 22:21
@@ -17,7 +18,16 @@ internal sealed class HostDiagnosticAnalyzerProvider(string? razorSourceGenerato
{
if (File.Exists(razorSourceGenerator))
{
return [(razorSourceGenerator, ProjectSystemProject.RazorVsixExtensionId)];
// we also have to redirect the utilities and object pool assemblies
var razorDir = Path.GetDirectoryName(razorSourceGenerator) ?? "";
Copy link
Member

Choose a reason for hiding this comment

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

What is the CWD for the OOP process? Cause I believe the code below will end up using CWD to resolve the relative paths. Is that going to work or fail due to missing files, etc ... Cause if it's going to fail would prefer we just throw an exception with a good message here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made it an exception if we can't find the dependencies

@chsienki
Copy link
Member Author

chsienki commented May 6, 2025

@dotnet/razor-compiler for a second review please :)

@dibarbet
Copy link
Member

dibarbet commented May 6, 2025

@chsienki the next C# ext prerelease is going out soon, which will become the next full release. Does this change need to make it in for the full (monthly) release? What is the impact of not having it?

@chsienki
Copy link
Member Author

chsienki commented May 6, 2025

@dibarbet Yes, we'll need to take this, Razor is currently broken without it.

@jaredpar
Copy link
Member

jaredpar commented May 7, 2025

@jjonescz, @333fred, @RikkiGibson PTAL

@chsienki chsienki merged commit fdbbf6b into dotnet:main May 7, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 7, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
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 VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants