Skip to content

Commit f96d8d8

Browse files
committed
Pass C# design time targets path to build
1 parent 0042452 commit f96d8d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lsptoolshost/server/roslynLanguageServer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,15 @@ export class RoslynLanguageServer {
706706
// Set command enablement to use roslyn standalone commands.
707707
await vscode.commands.executeCommand('setContext', 'dotnet.server.activationContext', 'Roslyn');
708708
_wasActivatedWithCSharpDevkit = false;
709+
710+
if (razorOptions.cohostingEnabled) {
711+
// Razor has code in Microsoft.CSharp.DesignTime.targets to handle non-Razor-SDK projects, but that doesn't get imported outside
712+
// of DevKit so we polyfill with a mini-version that Razor provides for that scenario.
713+
args.push(
714+
'--csharpDesignTimePath',
715+
path.join(razorComponentPath, 'Targets', 'Microsoft.CSharpExtension.DesignTime.targets')
716+
);
717+
}
709718
}
710719

711720
for (const extensionPath of additionalExtensionPaths) {

0 commit comments

Comments
 (0)