You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directly create virtual project when dotnet run-api is missing for now (#78788)
From discussion with @jasonmalinowski, we think we should keep in the
"directly creating" virtual project behavior that we had prior to
#78648, at minimum until we can be pretty sure .NET 10 users will have
an SDK with run-api available.
Without this change, users running with .NET 10 preview 4 SDK will not
get intellisense in VS Code. They would have to install a nightly .NET
10 or wait for preview 5 to come out.
I did manually verify that this change works when SDK is pinned to
preview 4. The log message about taking the fallback path gets written
out and so on.
Most of the change here is copy/pasted from deleted lines in the linked
PR #78648.
FYI @dibarbet we probably want to make sure this is in the next
prerelease that goes out. Apologies for the inconvenience.
Copy file name to clipboardExpand all lines: src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/FileBasedPrograms/FileBasedProgramsProjectSystem.cs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -135,8 +135,10 @@ public async ValueTask TryRemoveMiscellaneousDocumentAsync(DocumentUri uri, bool
if(contentis not var(virtualProjectContent,diagnostics))
137
137
{
138
-
// 'GetVirtualProjectContentAsync' will log errors when it fails
139
-
returnnull;
138
+
// https://github.com/dotnet/roslyn/issues/78618: falling back to this until dotnet run-api is more widely available
139
+
_logger.LogInformation($"Failed to obtain virtual project for '{documentPath}' using dotnet run-api. Falling back to directly creating the virtual project.");
// See https://github.com/dotnet/sdk/blob/5a4292947487a9d34f4256c1d17fb3dc26859174/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs#L449
0 commit comments