You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/BuildFromSource.md
+27-15Lines changed: 27 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,8 @@ Building ASP.NET Core on Windows (10, version 1803 or newer) requires that you h
42
42
Visual Studio 2019 (16.8) is required to build the repo locally. If you don't have visual studio installed you can run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1) to install the exact required dependencies.
43
43
44
44
> :bulb: By default, the script will install Visual Studio Enterprise Edition, however you can use a different edition by passing the `-Edition` flag.
45
-
> Even if you have installed Visual Studio, we still recommend using this script to install again to avoid errors due to missing components.
45
+
> :bulb: To install Visual Studio from the preview channel, you can use the `-Channel` flag to set the channel (`-Channel Preview`).
46
+
> :bulb: Even if you have installed Visual Studio, we still recommend using this script to install again to avoid errors due to missing components.
> You can do so by running the `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser` command
53
54
> in PowerShell. For more information on execution policies, you can read the [execution policy docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy).
54
55
55
-
If you already have Visual Studio installed, you can use the installation script above to ensure that you have the correct components installed.
56
+
The [global.json](/global.json) file specifies the minimum requirements needed to build using `msbuild`. The [eng/scripts/vs.json](/eng/scripts/vs.json) file provides a description of the components needed to build within VS. If you plan on developing in Visual Studio, you will need to have these components installed.
56
57
57
-
The [global.json](/global.json) and [eng/scripts/vs.json](/eng/scripts/vs.json) provide a description of the components required to support building the repo.
58
+
> :bulb: The `IntallVisualStudio.ps1` script mentioned above reads from the `vs.json` file to determine what components to install.
58
59
59
60
**[Git](https://git-scm.org)**
60
61
@@ -72,7 +73,7 @@ NodeJS installes the Node package manager (npm) by default. This repo depends on
72
73
npm install -g yarn
73
74
```
74
75
75
-
**Java Development Kit**
76
+
**Java Development Kit in Windows**
76
77
77
78
This repo contains some Java source code that depends on an install of the JDK v11 or newer. The JDK can be installed from either:
78
79
* OpenJDK <https://jdk.java.net/>
@@ -90,7 +91,11 @@ The build should find any JDK 11 or newer installation on the machine as long as
90
91
91
92
**Chrome**
92
93
93
-
This repo contains a Selenium-based tests require a version of Chrome to be installed. Download and install it from <https://www.google.com/chrome>
94
+
This repo contains a Selenium-based tests require a version of Chrome to be installed. Download and install it from <https://www.google.com/chrome>.
95
+
96
+
**Wix (Optional)**
97
+
98
+
If you plan on working with the Windows installers defined in [src/Installers/Windows](../src/Installers/Windows), you will need to install the Wix toolkit from https://wixtoolset.org/releases/.
94
99
95
100
### On macOS/Linux
96
101
@@ -106,6 +111,8 @@ If netier utility is installed, you can install curl (https://curl.haxx.se) or w
106
111
107
112
**Git**
108
113
114
+
If you've made it this far, you've already got `Git` installed. Sit back, relax, and move on to the next requirement.
115
+
109
116
**[NodeJS](https://nodejs.org)**
110
117
111
118
Building the repo requires version 10.14.2 or newer of Node. You can find installation executables for Node at https://nodejs.org.
@@ -124,21 +131,23 @@ This repo contains some Java source code that depends on an install of the JDK v
Similar to the instructions above for Windows, be sure that the the `JAVA_HOME` environment variable is set to the location of your Java installation.
134
+
Similar to [the instructions above for Windows](#java-development-kit-in-windows), be sure that the the `JAVA_HOME` environment variable is set to the location of your Java installation.
128
135
129
136
## Step 3: Build the repo
130
137
131
138
Before opening our .sln/.slnf files in Visual Studio or VS Code, you will need to build the repo locally.
132
139
133
140
### In Visual Studio
134
141
135
-
To build a version of the repo locally, you'll need to execute the following command.
142
+
To set up your project for development on Visual Studio, you'll need to execute the following command.
136
143
137
144
```ps1
138
145
PS1> .\restore.cmd
139
146
```
140
147
141
-
This will download the required tools and build the entire repository once. At that point, you should be able
148
+
> :bulb: If you happen to be working on macOS or Linux, you can use the `restore.sh` command.
149
+
150
+
This will download the required tools and restore all projects inside the repository. At that point, you should be able
142
151
to open the .sln file or one of the project specific .slnf files to work on the projects you care about.
143
152
144
153
> :bulb: Pro tip: you will also want to run this command after pulling large sets of changes. On the master
@@ -160,6 +169,8 @@ PS1> cd src\Components
160
169
PS1> .\startvs.cmd
161
170
```
162
171
172
+
After opening the solution in Visual Studio, you can build/rebuild using the controls in Visual Studio.
173
+
163
174
#### A brief interlude on solution files
164
175
165
176
We have a single .sln file for all of ASP.NET Core, but most people don't work with it directly because Visual Studio
@@ -175,7 +186,6 @@ These principles guide how we create and manage .slnf files:
175
186
2. Solution files group together projects which are frequently edited at the same time.
176
187
3. Can't find a solution that has the projects you care about? Feel free to make a PR to add a new .slnf file.
177
188
178
-
179
189
### In Visual Studio Code
180
190
181
191
Before opening the project in Visual Studio Code, you will need to make sure that you have built the project.
@@ -184,6 +194,8 @@ You can find more info on this in the "Building on command-line" section below.
184
194
Using Visual Studio Code with this repo requires setting environment variables on command line first.
185
195
Use these command to launch VS Code with the right settings.
186
196
197
+
> :bulb: Note that you'll need to launch Visual Studio Code from the command line in order to ensure that it picks up the environment variables. To learn more about the Visual Studio Code CLI, you can check out [the docs page](https://code.visualstudio.com/docs/editor/command-line).
198
+
187
199
On Windows (requires PowerShell):
188
200
189
201
```ps1
@@ -200,14 +212,14 @@ source activate.sh
200
212
code .
201
213
```
202
214
203
-
Note that if you are using the "Remote-WSL" extension in VSCode, the environment is not supplied
204
-
to the process in WSL. You can workaround this by explicitly setting the environment variables
205
-
in `~/.vscode-server/server-env-setup`.
206
-
See https://code.visualstudio.com/docs/remote/wsl#_advanced-environment-setup-script for details.
215
+
> :bulb:Note that if you are using the "Remote-WSL" extension in VSCode, the environment is not supplied
216
+
> to the process in WSL. You can workaround this by explicitly setting the environment variables
217
+
> in `~/.vscode-server/server-env-setup`.
218
+
> See https://code.visualstudio.com/docs/remote/wsl#_advanced-environment-setup-script for details.
207
219
208
220
## Building on command-line
209
221
210
-
You can also build the entire project on command line with the `build.cmd`/`.sh` scripts.
222
+
When developing in VS Code, you'll need to use the `build.cmd` or `build.sh` scripts in order to build the project. You can learn more about the command line options available, check out [the section below](using-dotnet-on-command-line-in-this-repo).
211
223
212
224
On Windows:
213
225
@@ -266,7 +278,7 @@ On macOS/Linux:
266
278
./build.sh --test
267
279
```
268
280
269
-
> :bulb: If you're working on changes for a particular subset of the project, you might not want to execute the entire test suite. Instead, only run the tests within the subdirectory where changes were made.
281
+
> :bulb: If you're working on changes for a particular subset of the project, you might not want to execute the entire test suite. Instead, only run the tests within the subdirectory where changes were made. This can be accomplished by passing the `projects` property like so: `.\build.cmd -test -projects .\src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj`.
0 commit comments