diff --git a/Microsoft.AspNetCore.sln b/Microsoft.AspNetCore.sln deleted file mode 100644 index 809b017e25f3..000000000000 --- a/Microsoft.AspNetCore.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EE2CAA71-82AA-41C0-AE87-5B4FB77D6CFE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedFx.UnitTests", "test\SharedFx.UnitTests\SharedFx.UnitTests.csproj", "{99CC38EC-902B-4B3F-AD33-177018110199}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x64.ActiveCfg = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x64.Build.0 = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x86.ActiveCfg = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Debug|x86.Build.0 = Debug|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|Any CPU.Build.0 = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x64.ActiveCfg = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x64.Build.0 = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x86.ActiveCfg = Release|Any CPU - {99CC38EC-902B-4B3F-AD33-177018110199}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {99CC38EC-902B-4B3F-AD33-177018110199} = {EE2CAA71-82AA-41C0-AE87-5B4FB77D6CFE} - EndGlobalSection -EndGlobal diff --git a/build/repo.props b/build/repo.props index ff0120ce5a0e..35e1ed077b78 100644 --- a/build/repo.props +++ b/build/repo.props @@ -51,6 +51,13 @@ + + + $(GetArtifactInfoDependsOn);ResolveRepoInfo + + $(RestoreDependsOn);RestoreNpm + + + + + + + install --no-optional + ci + + + + + diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index aee68a11f069..0a95e6cd55e9 100644 --- a/docs/BuildFromSource.md +++ b/docs/BuildFromSource.md @@ -1,16 +1,11 @@ Build ASP.NET Core from Source ============================== -Building ASP.NET Core from source allows you tweak and customize ASP.NET Core, and -to contribute your improvements back to the project. +Building ASP.NET Core from source allows you tweak and customize ASP.NET Core, and to contribute your improvements back to the project. -## :warning: Temporary instructions +:warning: We are currently in the middle of restructing our source code. These instructions will likely change rapidly during November and December 2018. -We are currently in the middle of restructing our repositories. While this work is being done, the following instructions will help you be more productive while working on this repo. - -1. Before opening a solution, run `build.cmd /p:_ProjectsOnly=true /p:SkipTests=true`. This will only build the projects which have merged into this repo, not the git submodules. -2. Use (or create) a solution which is scoped to your project file. The build system does not use .sln files. These only exist for developer productivity in Visual Studio, so feel free to adjust the projects in .sln files to match your workload. -3. Questions? Contact @aspnet for help. +See https://github.com/aspnet/AspNetCore/labels/area-infrastructure for known issues and to track ongoing work. ## Install pre-requistes @@ -58,22 +53,66 @@ git submodule update --init --recursive ## Building in Visual Studio / Code -Before opening our .sln files in Visual Studio or VS Code, executing the following on command-line: -``` -.\build.cmd /t:Restore -``` -This will download required tools. +Before opening our .sln files in Visual Studio or VS Code, you need to perform the following actions. + +1. Executing the following on command-line: + ``` + .\build.cmd /p:SkipTests=true /p:_ProjectsOnly=true + ``` + 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. 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. + +### Solution files + +We don't have a single .sln file for all of ASP.NET Core because Visual Studio doesn't currently handle projects of this scale. +Instead, we have many .sln files which include a sub-set of projects. These principles guide how we create and manage .slns: + +1. Solution files are not used by CI or command line build scripts. They are for meant for use by developers only. +2. Solution files group together projects which are frequently edited at the same time. +3. Can't find a solution that has the projects you care about? Feel free to make a PR to add a new .sln file. + +> :bulb: Pro tip: `dotnet new sln` and `dotnet sln` are one of the easiest ways to create and modify solutions. + +### Known issue: NU1105 + +Opening solution files may produce an error code NU1105 with a message such + +> Unable to find project information for 'C:\src\AspNetCore\src\Hosting\Abstractions\src\Microsoft.AspNetCore.Hosting.Abstractions.csproj'. Inside Visual Studio, this may be because the project is unloaded or not part of current solution. Otherwise the project file may be invalid or missing targets required for restore. + +This is a known issue in NuGet () and we are working with them for a solution. See also to track progress on this. + +**The workaround** for now is to add all projects to the solution. + + dotnet sln add C:\src\AspNetCore\src\Hosting\Abstractions\src\Microsoft.AspNetCore.Hosting.Abstractions.csproj + #### PATH -For VS Code and Visual Studio to work correctly, you must place the following location in your PATH. +For VS Code and Visual Studio and `dotnet` commands to work correctly, you must place the following location in your PATH. +Use the following commands to update the PATH variable in a command line window. + +Windows (Command Prompt) + +```batch +set PATH=%USERPROFILE%\.dotnet\x64;%PATH% +``` + +Windows (Powershell) + +```ps1 +$env:PATH="$env:USERPROFILE\.dotnet\x64;$env:PATH" ``` -Windows: %USERPROFILE%\.dotnet\x64 -Linux/macOS: $HOME/.dotnet + +Linux/macOS: + +```sh +export PATH="$HOME/.dotnet:$PATH" ``` -This must come **before** any other installation of `dotnet`. In Windows, we recommend removing `C:\Program Files\dotnet` from PATH in system variables and adding `%USERPROFILE%\.dotnet\x64` to PATH in user variables. - +On Windows, we recommend using the `startvs.cmd` command to launch Visual Studio. ## Building on command-line @@ -89,6 +128,14 @@ On macOS/Linux: ./build.sh ``` +### Building a subset of the code + +This repository is large. Look for `build.cmd`/`.sh` scripts in subfolders. These scripts can be used to invoke build and test on a smaller set of projects. + +#### Known issue: not every subfolder has a build.cmd script + +We'll be adding more. See https://github.com/aspnet/AspNetCore/issues/4247. + #### Build properties Additional properties can be added as an argument in the form `/property:$name=$value`, or `/p:$name=$value` for short. For example: @@ -99,8 +146,8 @@ Additional properties can be added as an argument in the form `/property:$name=$ Common properties include: Property | Description --------------------------|--------------------------------------------------------- -BuildNumber | (string). A specific build number, typically from a CI counter +-------------------------|------------------------------------------------------------------------------------------------------------- +BuildNumberSuffix | (string). A specific build number, typically from a CI counter, which is appended to the pre-release label. Configuration | `Debug` or `Release`. Default = `Debug`. SkipTests | `true` or `false`. When true, builds without running tests. NoBuild | `true` or `false`. Runs tests without rebuilding. @@ -109,7 +156,7 @@ NoBuild | `true` or `false`. Runs tests without rebuilding. After building ASP.NET Core from source, you will need to install and use your local version of ASP.NET Core. -- Run the installers produced in `artifacts/installers/` for your platform. +- Run the installers produced in `artifacts/{Debug, Release}/installers/` for your platform. - Add a NuGet.Config to your project directory with the following content: ```xml @@ -128,7 +175,7 @@ After building ASP.NET Core from source, you will need to install and use your l - Update the versions on `PackageReference` items in your .csproj project file to point to the version from your local build. ```xml - + ``` diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 689906d3cfb1..1a1f29b25155 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -55,5 +55,4 @@ - diff --git a/eng/targets/CSharp.Common.targets b/eng/targets/CSharp.Common.targets index a7f7b610b6e6..8df4213c6295 100644 --- a/eng/targets/CSharp.Common.targets +++ b/eng/targets/CSharp.Common.targets @@ -1,5 +1,11 @@ + + + net$(TargetFrameworkVersion.Substring(1).Replace('.','')) + .NETFramework + + diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index caf44207ee3c..7ff54b7d33bd 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -45,12 +45,18 @@ + + + <_ReferenceTemp Include="@(Reference)" /> + - + + <_ReferenceTemp Remove="@(_ReferenceTemp)" /> +