2
0

startvs.cmd 763 B

12345678910111213141516171819202122232425262728
  1. @ECHO OFF
  2. :: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK.
  3. :: This tells .NET Core to use the same dotnet.exe that build scripts use
  4. SET DOTNET_ROOT=%~dp0.dotnet\x64
  5. :: This tells .NET Core not to go looking for .NET Core in other places
  6. SET DOTNET_MULTILEVEL_LOOKUP=0
  7. :: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
  8. SET PATH=%DOTNET_ROOT%;%PATH%
  9. SET sln=%1
  10. IF "%sln%"=="" (
  11. echo Error^: Expected argument ^<SLN_FILE^>
  12. echo Usage^: startvs.cmd ^<SLN_FILE^>
  13. exit /b 1
  14. )
  15. IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
  16. echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
  17. exit /b 1
  18. )
  19. start %sln%