Skip to content

Commit 2cc071a

Browse files
authored
Update BuildFromSource.md to explain CS0006 errors (#10465)
1 parent f26b87a commit 2cc071a

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

docs/BuildFromSource.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Building ASP.NET Core on Windows requires:
2525
* Oracle's JDK <https://www.oracle.com/technetwork/java/javase/downloads/index.html>
2626
* To install a version of the JDK that will only be used by this repo, run [eng/scripts/InstallJdk.ps1](/eng/scripts/InstallJdk.ps1)
2727
```ps1
28-
PS> ./eng/scripts/InstalLJdk.ps1
28+
PS> ./eng/scripts/InstallJdk.ps1
2929
```
3030
3131
### macOS/Linux
@@ -81,21 +81,24 @@ Instead, we have many .sln files which include a sub-set of projects. These prin
8181
8282
> :bulb: Pro tip: `dotnet new sln` and `dotnet sln` are one of the easiest ways to create and modify solutions.
8383
84-
### Known issue: NU1105
84+
### Common error: CS0006
8585
86-
Opening solution files may produce an error code NU1105 with a message such
86+
Opening solution files and building may produce an error code CS0006 with a message such
8787
88-
> 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.
88+
> Error CS0006 Metadata file 'C:\src\aspnet\AspNetCore\artifacts\bin\Microsoft.AspNetCore.Metadata\Debug\netstandard2.0\Microsoft.AspNetCore.Metadata.dll' could not be found
8989
90-
This is a known issue in NuGet (<https://github.com/NuGet/Home/issues/5820>) and we are working with them for a solution. See also <https://github.com/aspnet/AspNetCore/issues/4183> to track progress on this.
90+
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.
9191
92-
**The workaround** for now is to add all projects to the solution. You can either do this one by one using `dotnet sln`
93-
94-
dotnet sln add C:\src\AspNetCore\src\Hosting\Abstractions\src\Microsoft.AspNetCore.Hosting.Abstractions.csproj
95-
96-
Or you can use this script to automatically traverse the project reference graph, which then invokes `dotnet sln` for you: [eng/scripts/AddAllProjectRefsToSolution.ps1](/eng/scripts/AddAllProjectRefsToSolution.ps1).
97-
98-
./eng/scripts/AddAllProjectRefsToSolution.ps1 -WorkingDir src/Mvc/
92+
**You can fix this in one of two ways**
93+
1. Build the project on command line. In most cases, running `build.cmd` on command line solve this problem.
94+
2. Update the solution to include the missing project. You can either do this one by one using `dotnet sln`
95+
```
96+
dotnet sln add C:\src\AspNetCore\src\Hosting\Abstractions\src\Microsoft.AspNetCore.Hosting.Abstractions.csproj
97+
```
98+
Or you can use this script to automatically traverse the project reference graph, which then invokes `dotnet sln` for you: [eng/scripts/AddAllProjectRefsToSolution.ps1](/eng/scripts/AddAllProjectRefsToSolution.ps1).
99+
```
100+
./eng/scripts/AddAllProjectRefsToSolution.ps1 -WorkingDir src/Mvc/
101+
```
99102
100103
## Building with Visual Studio Code
101104

0 commit comments

Comments
 (0)