Skip to content

Commit c517fac

Browse files
authored
Add local dev convenience scripts (dotnet#3389)
1 parent 5c741dc commit c517fac

File tree

3 files changed

+50
-318
lines changed

3 files changed

+50
-318
lines changed

build-local.ps1

-318
This file was deleted.

start-code.cmd

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@ECHO OFF
2+
SETLOCAL
3+
4+
:: This command launches a Visual Studio Code with environment variables required to use a local version of the .NET Core SDK.
5+
6+
FOR /f "delims=" %%a IN ('where.exe code') DO @SET vscode=%%a& GOTO break
7+
:break
8+
9+
IF ["%vscode%"] == [""] (
10+
echo [ERROR] Visual Studio Code is not installed or can't be found.
11+
exit /b 1
12+
)
13+
14+
:: This tells .NET Core to use the same dotnet.exe that build scripts use
15+
SET DOTNET_ROOT=%~dp0.dotnet
16+
SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
17+
18+
:: This tells .NET Core not to go looking for .NET Core in other places
19+
SET DOTNET_MULTILEVEL_LOOKUP=0
20+
21+
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
22+
SET PATH=%DOTNET_ROOT%;%PATH%
23+
24+
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
25+
echo [ERROR] .NET has not yet been installed. Run `%~dp0restore.cmd` to install tools
26+
exit /b 1
27+
)
28+
29+
"%vscode%" "."

start-vs.cmd

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@ECHO OFF
2+
SETLOCAL
3+
4+
:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK.
5+
6+
:: This tells .NET Core to use the same dotnet.exe that build scripts use
7+
SET DOTNET_ROOT=%~dp0.dotnet
8+
SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
9+
10+
:: This tells .NET Core not to go looking for .NET Core in other places
11+
SET DOTNET_MULTILEVEL_LOOKUP=0
12+
13+
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
14+
SET PATH=%DOTNET_ROOT%;%PATH%
15+
16+
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
17+
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
18+
exit /b 1
19+
)
20+
21+
start "" "Winforms.sln"

0 commit comments

Comments
 (0)