Skip to content

Commit 97d3a34

Browse files
authored
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)
1 parent f182b1a commit 97d3a34

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
107107
</PropertyGroup>
108108

109-
<Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks'" />
109+
<Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" />
110110

111111
<Import Project="eng\Dependencies.props" />
112112
<Import Project="eng\PatchConfig.props" />

docs/BuildFromSource.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ Before opening our .sln files in Visual Studio or VS Code, you need to perform t
6161

6262
1. Executing the following on command-line:
6363
```
64-
.\build.cmd
64+
.\restore.cmd
6565
```
6666
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.
6767

68-
2. Use the `startvs.cmd` script to open Visual Studio .sln files. This script first sets required environment variables.
68+
> :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.
69+
> You will need to restart Visual Studio every time we update the .NET Core SDK.
6970
70-
> :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.
71+
2. Use the `startvs.cmd` script to open Visual Studio .sln files. This script first sets required environment variables.
7172

7273
### Solution files
7374

startvs.cmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ SET PATH=%DOTNET_ROOT%;%PATH%
1717

1818
SET sln=%1
1919

20-
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
21-
echo .NET Core has not yet been installed. Run `build.cmd -restore` to install tools
22-
exit /b 1
23-
)
24-
2520
IF "%sln%"=="" (
2621
echo Error^: Expected argument ^<SLN_FILE^>
2722
echo Usage^: startvs.cmd ^<SLN_FILE^>
2823

2924
exit /b 1
3025
)
3126

27+
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
28+
echo .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
29+
exit /b 1
30+
)
31+
3232
start %sln%

0 commit comments

Comments
 (0)