From 97d3a34a3daf848beb0364c73feeb954852a7a0a Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 2 Jan 2019 10:30:09 -0800 Subject: [PATCH] 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) --- Directory.Build.props | 2 +- docs/BuildFromSource.md | 7 ++++--- startvs.cmd | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e255df9e9a..3b0e6e9dd3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -106,7 +106,7 @@ true - + diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index c13d20ec92..001b1c2206 100644 --- a/docs/BuildFromSource.md +++ b/docs/BuildFromSource.md @@ -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 diff --git a/startvs.cmd b/startvs.cmd index 79fde11abd..eb5818a0d7 100644 --- a/startvs.cmd +++ b/startvs.cmd @@ -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 ^ echo Usage^: startvs.cmd ^ @@ -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%