Fix VS errors about repotasks when repotasks have not been built, and update documentation to indicate that VS users should invoke restore.cmd first (#6295)

This commit is contained in:
Nate McMaster 2019-01-02 10:30:09 -08:00 committed by GitHub
parent f182b1adac
commit 97d3a34a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View File

@ -106,7 +106,7 @@
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
</PropertyGroup>
<Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks'" />
<Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" />
<Import Project="eng\Dependencies.props" />
<Import Project="eng\PatchConfig.props" />

View File

@ -61,13 +61,14 @@ Before opening our .sln files in Visual Studio or VS Code, you need to perform t
1. Executing the following on command-line:
```
.\build.cmd
.\restore.cmd
```
This will download required tools and build the entire repository once. At that point, you should be able to open .sln files to work on the projects you care about.
2. Use the `startvs.cmd` script to open Visual Studio .sln files. This script first sets required environment variables.
> :bulb: Pro tip: you will also want to run this command after pulling large sets of changes. On the master branch, we regularly update the versions of .NET Core SDK required to build the repo.
> You will need to restart Visual Studio every time we update the .NET Core SDK.
> :bulb: Pro tip: you will also want to run this command after pulling large sets of changes. Visual Studio will only build projects in a solution file, and makes a best effort to use other files on disk. If you pull many changes, the files on disk may be stale and will need to re-build.
2. Use the `startvs.cmd` script to open Visual Studio .sln files. This script first sets required environment variables.
### Solution files

View File

@ -17,11 +17,6 @@ SET PATH=%DOTNET_ROOT%;%PATH%
SET sln=%1
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo .NET Core has not yet been installed. Run `build.cmd -restore` to install tools
exit /b 1
)
IF "%sln%"=="" (
echo Error^: Expected argument ^<SLN_FILE^>
echo Usage^: startvs.cmd ^<SLN_FILE^>
@ -29,4 +24,9 @@ IF "%sln%"=="" (
exit /b 1
)
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
exit /b 1
)
start %sln%