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\x64
  5. )
  6. :: This tells .NET Core to use the same dotnet.exe that build scripts use
  7. SET DOTNET_ROOT=%DOTNET_HOME%
  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 NOT EXIST %DOTNET_ROOT%\dotnet.exe (
  14. echo .NET Core has not yet been installed. Run `build.cmd -restore` to install tools
  15. exit /b 1
  16. )
  17. IF "%sln%"=="" (
  18. echo Error^: Expected argument ^<SLN_FILE^>
  19. echo Usage^: startvs.cmd ^<SLN_FILE^>
  20. exit /b 1
  21. )
  22. start %sln%