startvs.cmd 834 B

1234567891011121314151617181920212223242526272829303132
  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. IF "%DOTNET_HOME%"=="" (
  4. set DOTNET_HOME=%USERPROFILE%\.dotnet
  5. )
  6. :: This tells .NET Core to use the same dotnet.exe that build scripts use
  7. SET DOTNET_ROOT=%DOTNET_HOME%\x64
  8. :: This tells .NET Core not to go looking for .NET Core in other places
  9. SET DOTNET_MULTILEVEL_LOOKUP=0
  10. :: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
  11. SET PATH=%DOTNET_ROOT%;%PATH%
  12. SET sln=%1
  13. IF "%sln%"=="" (
  14. echo Error^: Expected argument ^<SLN_FILE^>
  15. echo Usage^: startvs.cmd ^<SLN_FILE^>
  16. exit /b 1
  17. )
  18. IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
  19. echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
  20. exit /b 1
  21. )
  22. start %sln%