start-vs.cmd will point to instructions if no sln found (#4118)

Resolves #4116
This commit is contained in:
Igor Velikorossov 2023-06-26 18:35:27 +10:00 коммит произвёл GitHub
Родитель bb9d90008f
Коммит cb688f13c0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 18 добавлений и 6 удалений

Просмотреть файл

@ -98,12 +98,15 @@ To find out more about the script and its parameters run: `.\build.cmd -help`.
#### 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
> 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:
```powershell

Просмотреть файл

@ -7,7 +7,8 @@ FOR /f "delims=" %%a IN ('where.exe code') DO @SET vscode=%%a& GOTO break
:break
IF ["%vscode%"] == [""] (
echo [ERROR] Visual Studio Code is not installed or can't be found.
echo [ERROR] Visual Studio Code is not installed or can't be found.
echo.
exit /b 1
)
@ -22,7 +23,8 @@ SET DOTNET_MULTILEVEL_LOOKUP=0
SET PATH=%DOTNET_ROOT%;%PATH%
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET SDK has not yet been installed. Run `%~dp0restore.cmd` to install the toolset.
echo [ERROR] .NET SDK has not yet been installed. Run %~dp0restore.cmd to install.
echo.
exit /b 1
)

Просмотреть файл

@ -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
set PATH=%DOTNET_ROOT%;%PATH%
set SLN=SDK.sln
if not exist "%~dp0%SLN%" (
echo [ERROR] %~dp0%SLN% not found.
echo See %~dp0%docs\building.md for instructions on how to generate a solution file.
echo.
exit /b 1
)
call restore.cmd
if not exist "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
echo [ERROR] .NET SDK has not yet been installed. Run %~dp0restore.cmd to install.
echo.
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.
set "DEVENV=%DevEnvDir%devenv.exe"
set SLN=SDK.sln
if exist "%DEVENV%" (
:: Fully qualified works
set "COMMAND=start "" /B "%ComSpec%" /S /C ""%DEVENV%" "%~dp0%SLN%"""