Skip to content

Commit 3117f43

Browse files
authored
Migrate to single sln file + slnf files (#23581)
1 parent 1da13e6 commit 3117f43

File tree

101 files changed

+9049
-16076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+9049
-16076
lines changed

AspNetCore.sln

Lines changed: 7415 additions & 0 deletions
Large diffs are not rendered by default.

docs/BuildFromSource.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,48 +72,52 @@ git submodule update --init --recursive
7272

7373
## Building in Visual Studio
7474

75-
Before opening our .sln files in Visual Studio or VS Code, you need to perform the following actions.
75+
Before opening our .sln/.slnf files in Visual Studio or VS Code, you need to perform the following actions.
7676

7777
1. Executing the following on command-line:
7878

7979
```ps1
8080
.\restore.cmd
8181
```
8282

83-
This will download the 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.
83+
This will download the required tools and build the entire repository once. At that point, you should be able
84+
to open the .sln file or one of the project specific .slnf files to work on the projects you care about.
8485

85-
> :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.
86+
> :bulb: Pro tip: you will also want to run this command after pulling large sets of changes. On the master
87+
> branch, we regularly update the versions of .NET Core SDK required to build the repo.
8688
> You will need to restart Visual Studio every time we update the .NET Core SDK.
8789
88-
2. Use the `startvs.cmd` script to open Visual Studio .sln files. This script first sets the required environment variables.
90+
2. Use the `startvs.cmd` script to open Visual Studio .sln/.slnf files. This script first sets the required
91+
environment variables.
8992

9093
### Solution files
9194

92-
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.
93-
Instead, we have many .sln files which include a sub-set of projects. These principles guide how we create and manage .sln files:
95+
We have a single .sln file for all of ASP.NET Core, but most people don't work with it directly because Visual Studio
96+
doesn't currently handle projects of this scale very well.
97+
98+
Instead, we have many Solution Filter (.slnf) files which include a sub-set of projects. See the Visual Studio
99+
documentation [here](https://docs.microsoft.com/en-us/visualstudio/ide/filtered-solutions?view=vs-2019) for more
100+
information about Solution Filters.
101+
102+
These principles guide how we create and manage .slnf files:
94103

95104
1. Solution files are not used by CI or command line build scripts. They are meant for use by developers only.
96105
2. Solution files group together projects which are frequently edited at the same time.
97-
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.
98-
99-
> :bulb: Pro tip: `dotnet new sln` and `dotnet sln` are one of the easiest ways to create and modify solutions.
106+
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.
100107

101108
### Common error: CS0006
102109

103-
Opening solution files and building may produce an error code CS0006 with a message such
110+
Opening solution filters and building may produce an error code CS0006 with a message such
104111

105112
> Error CS0006 Metadata file 'C:\src\aspnet\AspNetCore\artifacts\bin\Microsoft.AspNetCore.Metadata\Debug\netstandard2.0\Microsoft.AspNetCore.Metadata.dll' could not be found
106113
107-
The cause of this problem is that the solution you are using does not include the project that produces this .dll. This most often occurs after we have added new projects to the repo, but failed to update our .sln files to include the new project. In some cases, it is sometimes the intended behavior of the .sln which has been crafted to only include a subset of projects.
114+
The cause of this problem is that the solution filter you are using does not include the project that produces this .dll. This most often occurs after we have added new projects to the repo, but failed to update our .sln/slnf files to include the new project. In some cases, it is sometimes the intended behavior of the .slnf which has been crafted to only include a subset of projects.
108115

109-
#### You can fix this in one of two ways
116+
#### You can fix this in one of three ways
110117

111118
1. Build the project on command line. In most cases, running `build.cmd` on command line solves this problem.
112-
2. Update the solution to include the missing project. You can either do this one by one using `dotnet sln`
113-
114-
```ps1
115-
dotnet sln add C:\src\AspNetCore\src\Hosting\Abstractions\src\Microsoft.AspNetCore.Hosting.Abstractions.csproj
116-
```
119+
2. If the project is missing from the .sln file entirely, you can use `dotnet sln add` to add it, or else right click on the solution/folder in Visual Studio and choose Add->Existing Project, and adding it.
120+
3. If it is present in the .sln, but not the .slnf, you can update the solution filter to include the missing project. You can either do this one by right-clicking on project in Visual Studio and choosing to load it's direct dependencies, and then saving. Alternatively, you can hand edit the .slnf file - it's a fairly simple json format.
117121

118122
### Common error: Unable to locate the .NET Core SDK
119123

@@ -230,7 +234,7 @@ TargetOsName | The base runtime identifier to build for (win, linux,
230234
After building ASP.NET Core from source, you will need to install and use your local version of ASP.NET Core.
231235
See ["Artifacts"](./Artifacts.md) for more explanation of the different folders produced by a build.
232236

233-
Building installers does not run as part of `build.cmd` run without parameters, so you should opt-in for building them:
237+
Building installers does not run as part of `build.cmd` run without parameters, so you should opt-in for building them:
234238

235239
```ps1
236240
.\build.cmd -all -pack -arch x64

eng/tools/startvs.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@ECHO OFF
22

3-
%~dp0..\..\startvs.cmd %~dp0tools.sln
3+
%~dp0..\..\startvs.cmd %~dp0tools.slnf

eng/tools/tools.sln

Lines changed: 0 additions & 48 deletions
This file was deleted.

eng/tools/tools.slnf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"solution": {
3+
"path": "..\\..\\AspNetCore.sln",
4+
"projects" : [
5+
"eng\\tools\\BaselineGenerator\\BaselineGenerator.csproj",
6+
"eng\\tools\\RepoTasks\\RepoTasks.csproj"
7+
]
8+
}
9+
}

0 commit comments

Comments
 (0)