startvs.cmd 907 B

1234567891011121314151617181920212223242526272829303132333435
  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
  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. SET sln=%~1
  12. IF "%sln%"=="" (
  13. echo Error^: Expected argument ^<SLN_FILE^>
  14. echo Usage^: startvs.cmd ^<SLN_FILE^>
  15. exit /b 1
  16. )
  17. IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
  18. echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
  19. exit /b 1
  20. )
  21. IF "%VSINSTALLDIR%" == "" (
  22. start "" "%sln%"
  23. ) else (
  24. "%VSINSTALLDIR%\Common7\IDE\devenv.com" "%sln%"
  25. )