-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add batch files to launch Visual Studio (Code) with the locally installed .NET SDK version for use with daily builds.
- Loading branch information
1 parent
b37d844
commit c0093f9
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@ECHO OFF | ||
SETLOCAL | ||
|
||
:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET SDK. | ||
|
||
:: This tells .NET to use the same dotnet.exe that the build script uses. | ||
SET DOTNET_ROOT=%~dp0.dotnetcli | ||
SET DOTNET_ROOT(x86)=%~dp0.dotnetcli\x86 | ||
|
||
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use. | ||
SET PATH=%DOTNET_ROOT%;%PATH% | ||
|
||
SET sln=%~dp0ProjectEuler.sln | ||
|
||
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" ( | ||
echo The .NET SDK has not yet been installed. Run `%~dp0build.ps1` to install it | ||
exit /b 1 | ||
) | ||
|
||
IF "%VSINSTALLDIR%" == "" ( | ||
start "" "%sln%" | ||
) else ( | ||
"%VSINSTALLDIR%\Common7\IDE\devenv.com" "%sln%" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@ECHO OFF | ||
SETLOCAL | ||
|
||
:: This command launches Visual Studio Code with environment variables required to use a local version of the .NET SDK. | ||
|
||
:: This tells .NET to use the same dotnet.exe that the build script uses. | ||
SET DOTNET_ROOT=%~dp0.dotnetcli | ||
SET DOTNET_ROOT(x86)=%~dp0.dotnetcli\x86 | ||
|
||
:: Put our local dotnet.exe on PATH first so Visual Studio Code knows which one to use. | ||
SET PATH=%DOTNET_ROOT%;%PATH% | ||
|
||
:: Sets the Target Framework for Visual Studio Code. | ||
SET TARGET=net9.0 | ||
|
||
SET FOLDER=%~1 | ||
|
||
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" ( | ||
echo The .NET SDK has not yet been installed. Run `%~dp0build.ps1` to install it | ||
exit /b 1 | ||
) | ||
|
||
IF "%FOLDER%"=="" ( | ||
code . | ||
) else ( | ||
code "%FOLDER%" | ||
) | ||
|
||
exit /b 1 |