diff --git a/build/buildorder.props b/build/buildorder.props index 25c647ca23..21999af70f 100644 --- a/build/buildorder.props +++ b/build/buildorder.props @@ -10,7 +10,6 @@ - diff --git a/build/repo.props b/build/repo.props index 9b0b4585d7..f96466ea7b 100644 --- a/build/repo.props +++ b/build/repo.props @@ -56,6 +56,13 @@ + + + - diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index aee68a11f0..0a95e6cd55 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. -``` -Windows: %USERPROFILE%\.dotnet\x64 -Linux/macOS: $HOME/.dotnet -``` -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. +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" +``` + +Linux/macOS: + +```sh +export PATH="$HOME/.dotnet:$PATH" +``` + +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.Designer.props b/eng/Baseline.Designer.props index 4c1e38844d..8f5460b224 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -509,6 +509,17 @@ + + + 2.2.0 + + + + + + + + 2.2.0 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index d88dbac121..97364fe67c 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -52,6 +52,7 @@ + diff --git a/eng/Dependencies.props b/eng/Dependencies.props index 48dbf486dd..1c132cfb36 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -19,6 +19,8 @@ + + diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props index e8ca163451..c02c9991e9 100644 --- a/eng/ProjectReferences.props +++ b/eng/ProjectReferences.props @@ -41,6 +41,7 @@ + diff --git a/eng/targets/CSharp.Common.targets b/eng/targets/CSharp.Common.targets index a7f7b610b6..8df4213c62 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 897a906869..675b0efa18 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -46,12 +46,18 @@ + + + <_ReferenceTemp Include="@(Reference)" /> + - + + <_ReferenceTemp Remove="@(_ReferenceTemp)" /> + - 99.9 - - diff --git a/src/Session/NuGetPackageVerifier.json b/src/Session/NuGetPackageVerifier.json deleted file mode 100644 index b153ab1515..0000000000 --- a/src/Session/NuGetPackageVerifier.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Default": { - "rules": [ - "DefaultCompositeRule" - ] - } -} \ No newline at end of file diff --git a/src/Session/README.md b/src/Session/README.md deleted file mode 100644 index 976f9f21cf..0000000000 --- a/src/Session/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Session -================ - -AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/yyivj6uwu3uj2x40/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Session/branch/dev) - -Travis: [![Travis](https://travis-ci.org/aspnet/Session.svg?branch=dev)](https://travis-ci.org/aspnet/Session) - -Contains libraries for session state middleware for ASP.NET Core. - -For ASP.NET 4.x session state, please go to https://github.com/aspnet/AspNetSessionState. - -This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/src/Session/Session.sln b/src/Session/Session.sln deleted file mode 100644 index d8d95dc295..0000000000 --- a/src/Session/Session.sln +++ /dev/null @@ -1,74 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26621.2 -MinimumVisualStudioVersion = 15.0.26730.03 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E9D63F97-6078-42AD-BFD3-F956BF921BB5}" - ProjectSection(SolutionItems) = preProject - test\Directory.Build.props = test\Directory.Build.props - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A189F10C-3A9C-4F81-83D0-32E5FE50DAD8}" - ProjectSection(SolutionItems) = preProject - src\Directory.Build.props = src\Directory.Build.props - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Session", "src\Microsoft.AspNetCore.Session\Microsoft.AspNetCore.Session.csproj", "{71802736-F640-4733-9671-02D267EDD76A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Session.Tests", "test\Microsoft.AspNetCore.Session.Tests\Microsoft.AspNetCore.Session.Tests.csproj", "{8C131A0A-BC1A-4CF3-8B77-8813FBFE5639}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{94E80ED2-9F27-40AC-A9EF-C707BDFAA3BE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionSample", "samples\SessionSample\SessionSample.csproj", "{FE0B9969-3BDE-4A7D-BE1B-47EAE8DBF365}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{3B45F658-5BF1-4E07-BE9C-6F5110AC2277}" - ProjectSection(SolutionItems) = preProject - .appveyor.yml = .appveyor.yml - .gitattributes = .gitattributes - .gitignore = .gitignore - .travis.yml = .travis.yml - Directory.Build.props = Directory.Build.props - Directory.Build.targets = Directory.Build.targets - NuGet.config = NuGet.config - NuGetPackageVerifier.json = NuGetPackageVerifier.json - README.md = README.md - version.xml = version.xml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{4F21221F-2813-41B7-AAFC-E03FD52971CC}" - ProjectSection(SolutionItems) = preProject - build\common.props = build\common.props - build\dependencies.props = build\dependencies.props - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {71802736-F640-4733-9671-02D267EDD76A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71802736-F640-4733-9671-02D267EDD76A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71802736-F640-4733-9671-02D267EDD76A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71802736-F640-4733-9671-02D267EDD76A}.Release|Any CPU.Build.0 = Release|Any CPU - {8C131A0A-BC1A-4CF3-8B77-8813FBFE5639}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C131A0A-BC1A-4CF3-8B77-8813FBFE5639}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C131A0A-BC1A-4CF3-8B77-8813FBFE5639}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C131A0A-BC1A-4CF3-8B77-8813FBFE5639}.Release|Any CPU.Build.0 = Release|Any CPU - {FE0B9969-3BDE-4A7D-BE1B-47EAE8DBF365}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FE0B9969-3BDE-4A7D-BE1B-47EAE8DBF365}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE0B9969-3BDE-4A7D-BE1B-47EAE8DBF365}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FE0B9969-3BDE-4A7D-BE1B-47EAE8DBF365}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {71802736-F640-4733-9671-02D267EDD76A} = {A189F10C-3A9C-4F81-83D0-32E5FE50DAD8} - {8C131A0A-BC1A-4CF3-8B77-8813FBFE5639} = {E9D63F97-6078-42AD-BFD3-F956BF921BB5} - {FE0B9969-3BDE-4A7D-BE1B-47EAE8DBF365} = {94E80ED2-9F27-40AC-A9EF-C707BDFAA3BE} - {4F21221F-2813-41B7-AAFC-E03FD52971CC} = {3B45F658-5BF1-4E07-BE9C-6F5110AC2277} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6AE224B9-B604-4E47-9617-9D114DAE9BE5} - EndGlobalSection -EndGlobal diff --git a/src/Session/build/Key.snk b/src/Session/build/Key.snk deleted file mode 100644 index e10e4889c1..0000000000 Binary files a/src/Session/build/Key.snk and /dev/null differ diff --git a/src/Session/build/dependencies.props b/src/Session/build/dependencies.props deleted file mode 100644 index 78eb063ed4..0000000000 --- a/src/Session/build/dependencies.props +++ /dev/null @@ -1,30 +0,0 @@ - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - 2.2.0-preview2-20181004.6 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.2.0-preview3-35425 - 2.0.9 - 2.1.3 - 2.2.0-preview3-27001-02 - 15.6.1 - 2.0.3 - 2.3.1 - 2.4.0 - - - - diff --git a/src/Session/build/repo.props b/src/Session/build/repo.props deleted file mode 100644 index e3e0fa123b..0000000000 --- a/src/Session/build/repo.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/Session/build/sources.props b/src/Session/build/sources.props deleted file mode 100644 index 9215df9751..0000000000 --- a/src/Session/build/sources.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - - $(DotNetRestoreSources) - - $(RestoreSources); - https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; - - - $(RestoreSources); - https://api.nuget.org/v3/index.json; - - - diff --git a/src/Session/samples/SessionSample/Properties/launchSettings.json b/src/Session/samples/SessionSample/Properties/launchSettings.json deleted file mode 100644 index 6bab3d3602..0000000000 --- a/src/Session/samples/SessionSample/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:2481/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "SessionSample": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/Session/samples/SessionSample/SessionSample.csproj b/src/Session/samples/SessionSample/SessionSample.csproj deleted file mode 100644 index 103dffc357..0000000000 --- a/src/Session/samples/SessionSample/SessionSample.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp2.2;net461 - - - - - - - - - - - - - - - - diff --git a/src/Session/src/Directory.Build.props b/src/Session/src/Directory.Build.props deleted file mode 100644 index 1e0980f663..0000000000 --- a/src/Session/src/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Session/src/Microsoft.AspNetCore.Session/Microsoft.AspNetCore.Session.csproj b/src/Session/src/Microsoft.AspNetCore.Session/Microsoft.AspNetCore.Session.csproj deleted file mode 100644 index 3da00b9032..0000000000 --- a/src/Session/src/Microsoft.AspNetCore.Session/Microsoft.AspNetCore.Session.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - ASP.NET Core session state middleware. - netstandard2.0 - $(NoWarn);CS1591 - true - true - aspnetcore;session;sessionstate - - - - - - - - - - - diff --git a/src/Session/test/Directory.Build.props b/src/Session/test/Directory.Build.props deleted file mode 100644 index 3a373e2cb8..0000000000 --- a/src/Session/test/Directory.Build.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - - netcoreapp2.2 - $(DeveloperBuildTestTfms) - - $(StandardTestTfms);net461 - - - - - - diff --git a/src/Session/test/Microsoft.AspNetCore.Session.Tests/Microsoft.AspNetCore.Session.Tests.csproj b/src/Session/test/Microsoft.AspNetCore.Session.Tests/Microsoft.AspNetCore.Session.Tests.csproj deleted file mode 100644 index 9dc11b9d2f..0000000000 --- a/src/Session/test/Microsoft.AspNetCore.Session.Tests/Microsoft.AspNetCore.Session.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - $(StandardTestTfms) - true - true - - - - - - - - - - - - - - - - diff --git a/src/Session/version.props b/src/Session/version.props deleted file mode 100644 index 4889a26987..0000000000 --- a/src/Session/version.props +++ /dev/null @@ -1,12 +0,0 @@ - - - 2.2.0 - rtm - $(VersionPrefix) - $(VersionPrefix)-$(VersionSuffix)-final - t000 - a- - $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) - $(VersionSuffix)-$(BuildNumber) - - diff --git a/startvs.cmd b/startvs.cmd new file mode 100644 index 0000000000..05cd3ebfda --- /dev/null +++ b/startvs.cmd @@ -0,0 +1,32 @@ +@ECHO OFF + +:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK. + +IF "%DOTNET_HOME%"=="" ( + set DOTNET_HOME=%USERPROFILE%\.dotnet\x64 +) + +:: This tells .NET Core to use the same dotnet.exe that build scripts use +SET DOTNET_ROOT=%DOTNET_HOME% + +:: This tells .NET Core not to go looking for .NET Core in other places +SET DOTNET_MULTILEVEL_LOOKUP=0 + +:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use +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 ^ + + exit /b 1 +) + +start %sln%