startvscode.cmd 803 B

1234567891011121314151617181920212223242526272829303132
  1. @ECHO OFF
  2. SETLOCAL
  3. :: This command launches a Visual Studio Code with environment variables required to use a local version of the .NET Core SDK.
  4. :: This tells .NET Core to use the same dotnet.exe that build scripts use
  5. SET DOTNET_ROOT=%~dp0.dotnet
  6. SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
  7. :: This tells .NET Core not to go looking for .NET Core in other places
  8. SET DOTNET_MULTILEVEL_LOOKUP=0
  9. :: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
  10. SET PATH=%DOTNET_ROOT%;%PATH%
  11. :: Sets TFW for Visual Studio Code usage
  12. SET TARGET=net10.0
  13. SET folder=%~1
  14. IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
  15. echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
  16. exit /b 1
  17. )
  18. IF "%folder%"=="" (
  19. code .
  20. ) else (
  21. code "%folder%"
  22. )
  23. exit /b 1