forked from dotnet/efcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartvs.cmd
More file actions
30 lines (21 loc) · 766 Bytes
/
Copy pathstartvs.cmd
File metadata and controls
30 lines (21 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@ECHO OFF
:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK.
:: This tells .NET Core to use .dotnet\dotnet.exe, unless a global install dir is specified
IF DEFINED DOTNET_GLOBAL_INSTALL_DIR (
SET DOTNET_ROOT=%DOTNET_GLOBAL_INSTALL_DIR%
) ELSE (
SET DOTNET_ROOT=%~dp0.dotnet\
)
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
SET PATH=%DOTNET_ROOT%;%PATH%
SET sln=%1
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
call restore.cmd
)
echo ProTip^: You can drag and drop a solution file onto startvs.cmd
IF "%sln%"=="" (
echo Error^: Expected argument ^<SLN_FILE^>
echo Usage^: startvs.cmd ^<SLN_FILE^>
exit /b 1
)
start %sln%