- Notifications
You must be signed in to change notification settings - Fork 10.3k
/
Copy pathstartvscode.cmd
32 lines (23 loc) · 803 Bytes
/
startvscode.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@ECHOOFF
SETLOCAL
:: This command launches a Visual Studio Code with environment variables required to use a local version of the .NET Core SDK.
:: This tells .NET Core to use the same dotnet.exe that build scripts use
SETDOTNET_ROOT=%~dp0.dotnet
SETDOTNET_ROOT(x86)=%~dp0.dotnet\x86
:: This tells .NET Core not to go looking for .NET Core in other places
SETDOTNET_MULTILEVEL_LOOKUP=0
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
SETPATH=%DOTNET_ROOT%;%PATH%
:: Sets TFW for Visual Studio Code usage
SETTARGET=net10.0
SETfolder=%~1
IFNOTEXIST"%DOTNET_ROOT%\dotnet.exe" (
echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
exit /b 1
)
IF"%folder%"=="" (
code .
) else (
code "%folder%"
)
exit /b 1