Skip to content

Commit 7f33e6a

Browse files
committed
dotnet script register doesn't work if VSCode has registered for the .csx extension.
1 parent 1169314 commit 7f33e6a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Dotnet.Script.Core/Scaffolder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public void RegisterFileHandler()
8181
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
8282
{
8383
// register dotnet-script as the tool to process .csx files
84+
_commandRunner.Execute("reg", @"delete HKCU\Software\classes\.csx /f");
8485
_commandRunner.Execute("reg", @"add HKCU\Software\classes\.csx /f /ve /t REG_SZ /d dotnetscript");
8586
_commandRunner.Execute("reg", $@"add HKCU\Software\Classes\dotnetscript\Shell\Open\Command /f /ve /t REG_EXPAND_SZ /d ""\""%ProgramFiles%\dotnet\dotnet.exe\"" script \""%1\"" -- %*""");
8687
}

0 commit comments

Comments
 (0)