startvs.cmd 772 B

1234567891011121314151617181920212223242526272829
  1. @ECHO OFF
  2. SETLOCAL
  3. :: This command launches a Visual Studio solution 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\x64
  6. :: This tells .NET Core not to go looking for .NET Core in other places
  7. SET DOTNET_MULTILEVEL_LOOKUP=0
  8. :: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
  9. SET PATH=%DOTNET_ROOT%;%PATH%
  10. SET sln=%1
  11. IF "%sln%"=="" (
  12. echo Error^: Expected argument ^<SLN_FILE^>
  13. echo Usage^: startvs.cmd ^<SLN_FILE^>
  14. exit /b 1
  15. )
  16. IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
  17. echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
  18. exit /b 1
  19. )
  20. start %sln%