зеркало из https://github.com/dotnet/extensions.git
start-vs.cmd will point to instructions if no sln found (#4118)
Resolves #4116
This commit is contained in:
Родитель
bb9d90008f
Коммит
cb688f13c0
|
@ -98,12 +98,15 @@ To find out more about the script and its parameters run: `.\build.cmd -help`.
|
||||||
|
|
||||||
#### TL;DR
|
#### TL;DR
|
||||||
|
|
||||||
Generating a new solution and opening it in Visual Studio is as easy as running:
|
Generating a new "filtered" solution and opening it in Visual Studio is as easy as running:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
> build.cmd -vs <keywords>
|
> build.cmd -vs <keywords>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For example, to generate a solution that contains projects with "Http" and "Fakes" in their names you can run: `.\build.cmd -vs Http,Fakes`.<br />
|
||||||
|
If for some reason you wish to generate a solution with all projects you can pass `*` for the keyword, e.g.: `.\build.cmd -vs *`.
|
||||||
|
|
||||||
If you already have a solution you'd like to open in Visual Studio then run the following command:
|
If you already have a solution you'd like to open in Visual Studio then run the following command:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
|
|
|
@ -7,7 +7,8 @@ FOR /f "delims=" %%a IN ('where.exe code') DO @SET vscode=%%a& GOTO break
|
||||||
:break
|
:break
|
||||||
|
|
||||||
IF ["%vscode%"] == [""] (
|
IF ["%vscode%"] == [""] (
|
||||||
echo [ERROR] Visual Studio Code is not installed or can't be found.
|
echo [41m[ERROR][0m Visual Studio Code is not installed or can't be found.
|
||||||
|
echo.
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,7 +23,8 @@ SET DOTNET_MULTILEVEL_LOOKUP=0
|
||||||
SET PATH=%DOTNET_ROOT%;%PATH%
|
SET PATH=%DOTNET_ROOT%;%PATH%
|
||||||
|
|
||||||
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
|
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
|
||||||
echo [ERROR] .NET SDK has not yet been installed. Run `%~dp0restore.cmd` to install the toolset.
|
echo [41m[ERROR][0m .NET SDK has not yet been installed. Run [93m%~dp0restore.cmd[0m to install.
|
||||||
|
echo.
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
13
start-vs.cmd
13
start-vs.cmd
|
@ -13,18 +13,25 @@ set DOTNET_MULTILEVEL_LOOKUP=0
|
||||||
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
|
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
|
||||||
set PATH=%DOTNET_ROOT%;%PATH%
|
set PATH=%DOTNET_ROOT%;%PATH%
|
||||||
|
|
||||||
|
set SLN=SDK.sln
|
||||||
|
if not exist "%~dp0%SLN%" (
|
||||||
|
echo [41m[ERROR][0m %~dp0%SLN% not found.
|
||||||
|
echo See [93m%~dp0%docs\building.md[0m for instructions on how to generate a solution file.
|
||||||
|
echo.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
call restore.cmd
|
call restore.cmd
|
||||||
|
|
||||||
if not exist "%DOTNET_ROOT%\dotnet.exe" (
|
if not exist "%DOTNET_ROOT%\dotnet.exe" (
|
||||||
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
|
echo [41m[ERROR][0m .NET SDK has not yet been installed. Run [93m%~dp0restore.cmd[0m to install.
|
||||||
|
echo.
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Prefer the VS in the developer command prompt if we're in one, followed by whatever shows up in the current search path.
|
:: Prefer the VS in the developer command prompt if we're in one, followed by whatever shows up in the current search path.
|
||||||
set "DEVENV=%DevEnvDir%devenv.exe"
|
set "DEVENV=%DevEnvDir%devenv.exe"
|
||||||
|
|
||||||
set SLN=SDK.sln
|
|
||||||
|
|
||||||
if exist "%DEVENV%" (
|
if exist "%DEVENV%" (
|
||||||
:: Fully qualified works
|
:: Fully qualified works
|
||||||
set "COMMAND=start "" /B "%ComSpec%" /S /C ""%DEVENV%" "%~dp0%SLN%"""
|
set "COMMAND=start "" /B "%ComSpec%" /S /C ""%DEVENV%" "%~dp0%SLN%"""
|
||||||
|
|
Загрузка…
Ссылка в новой задаче