forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further centralize shared Fx and TFM transition workarounds (dotnet#2…
…7473) * Further centralize shared Fx and TFM transition workarounds - make generated `Directory.Build.*` files more widely applicable - warn if requested Microsoft.AspNetCore.App version does not exist in `$(DOTNET_ROOT)` - add `$(UpdateAspNetCoreKnownFramework)` for Microsoft.AspNetCore.App `@(KnownFrameworkReference)` update - remove central `$(BuildingTestAppsIndependently)` special case - not needed because compiler toolset version is always available - correct `$(KnownAppHostPackOrFrameworkReferenceTfm)` when not targeting the default TFM - use MSBuild intrinsic functions for this and in framework projects; future-proofing - correct `@(KnownFrameworkReference)` metadata when in servicing - should not override default runtime and targeting pack versions - use generated `Directory.Build.*` files in regular build - remove now-duplicate property and item settings outside generated `Directory.Build.*` files - use generated `Directory.Build.*` files for local Razor tests - set `$(TargetLatestRuntimePatch)` instead of `$(RuntimeFrameworkVersion)`; simpler - do not restore Razor SDK test asset projects until just before tests run - depend on Microsoft.AspNetCore.App projects - disable `$(TreatWarningsAsErrors)` for a few Razor SDK tests - tests expect projects to build successfully despite a few warnings - improve (widen) Microsoft.AspNetCore.App `Condition` in Blazor SDK tests nit: do not pass `$(MicrosoftNetCompilersToolsetVersion)` into Razor test asset projects - not needed because generated files already contain the right information - even without that, the Directory.Build.props file imports eng/Versions.props * Use generated `Directory.Build.*` files for local template tests - move Infrastructure/ files to TestInfrastructure/ - Infrastructure/ sub-directories were functionally identical - move shared parts of template test project files to PrepareForTest.targets * Describe errors with missing generated files and the new warning in BuildFromSource.md - address numerous Markdown lint warnings, typos, and spelling mistakes in this file * Apply suggestions from code review - thanks @captainsafia * Move all troubleshooting information into BuildErrors.md - some was already duplicated - fix Markdown lint issues in BuildErrors.md too * Reorder App.Runtime build slightly - move `_InstallFrameworkIntoLocalDotNet` earlier because other builds depend on this part - this target sometimes executes after dependent projects continue - add `DependsOnTargets` attributes to further constrain ordering nit: `IncludeFrameworkListFile` should run before `_ResolveSharedFrameworkContent` * Add temporary workaround for `[AssemblyVersion]` changes * Address @wtgodbe's nit from dotnet#27653 - dotnet#27653 (review) Co-authored-by: Safia Abdalla <safia@microsoft.com>
- Loading branch information
1 parent
da3e434
commit 5fd1db2
Showing
32 changed files
with
399 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,96 @@ | ||
Build Errors | ||
------------ | ||
# Build Errors | ||
|
||
This document is for common build errors and how to resolve them. | ||
|
||
### Warning BUILD001 | ||
## Warning BUILD001 | ||
|
||
> warning BUILD001: Package references changed since the last release... | ||
> warning BUILD001: Reference to '…' was removed since the last stable release of this package. … | ||
This warning indicates a breaking change might have been made to a package or assembly due to the removal of a reference which was used | ||
in a previous release of this assembly. See <./ReferenceResolution.md> for how to suppress. | ||
in a previous release of this assembly. See [ReferenceResolution](./ReferenceResolution.md) for how to suppress. | ||
|
||
### Error BUILD002 | ||
## Error BUILD002 | ||
|
||
> error BUILD002: Package references changed since the last release... | ||
> error BUILD002: Package references changed since the last release… | ||
Similar to BUILD001, but this error is not suppressable. This error only appears in servicing builds, which should not change references between assemblies or packages. | ||
Similar to BUILD001, but this error is not suppressible. This error only appears in servicing builds, which should not change references between assemblies or packages. | ||
|
||
### Error BUILD003 | ||
## Error BUILD003 | ||
|
||
> error BUILD003: Multiple project files named 'Banana.csproj' exist. Project files should have a unique name to avoid conflicts in build output. | ||
This repo uses a common output directory (artifacts/bin/$(ProjectName) and artifacts/obj/$(ProjectName)). To avoid confllicts in build output, each | ||
This repo uses a common output directory (artifacts/bin/$(ProjectName) and artifacts/obj/$(ProjectName)). To avoid conflicts in build output, each | ||
project file should have a unique name. | ||
|
||
### Error MSB4236 / Unable to locate the .NET Core SDK | ||
|
||
## Error CS0006 | ||
|
||
Opening solution filters and building may produce an error code CS0006 with a message such as | ||
|
||
> Error CS0006 Metadata file '…\AspNetCore\artifacts\bin\Microsoft.AspNetCore.Metadata\Debug\netstandard2.0\Microsoft.AspNetCore.Metadata.dll' could not be found | ||
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. | ||
|
||
### You can fix this in one of three ways | ||
|
||
1. Build the project on command line. In most cases, running `build.cmd` on command line solves this problem. | ||
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. | ||
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. | ||
|
||
## Error MSB4019: The imported project "…\artifacts\bin\GenerateFiles\Directory.Build.props" was not found | ||
|
||
You have likely attempted to use `dotnet` to build a project in the repo without first generating the required files. | ||
Prior to building without `.\build.cmd` or `./build.sh` at least the following **must** be executed: | ||
|
||
```powershell | ||
.\build.cmd -noBuildNative -noBuildManaged | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
./build.sh --no-build-managed | ||
``` | ||
|
||
## Error MSB4236: Unable to locate the .NET Core SDK | ||
|
||
Executing `.\restore.cmd` or `.\build.cmd` may produce these errors: | ||
|
||
> error : Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version. | ||
> error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. | ||
In most cases, this is because the option _Use previews of the .NET Core SDK_ in VS2019 is not checked. Start Visual Studio, go to _Tools > Options_ and check _Use previews of the .NET Core SDK_ under _Environment > Preview Features_. | ||
|
||
## Error: HTTP Error 500.33 - ANCM Request Handler Load Failure | ||
|
||
The [ASP.NET Core Module](https://docs.microsoft.com/aspnet/core/host-and-deploy/aspnet-core-module) (ANCM) for IIS is not supported when running projects in this repository. | ||
|
||
After using `startvs.cmd` to open a solution in Visual Studio, the Kestrel web host option must be used (name of the project) and not IIS Express. | ||
|
||
Example of running the `MvcSandbox` project: | ||
|
||
`.\startvs.cmd .\src\Mvc\Mvc.sln` | ||
|
||
![Web host options in Visual Studio](./vs-iis-express-aspnet-core-mvc-sandbox.jpg) | ||
|
||
## Error: Unable to load the service index for … | ||
|
||
When attempting to restore servicing tags e.g. `v3.1.7`, the NuGet.config file may contain internal feeds that are not accessible. This will result in errors such as | ||
|
||
> …\aspnetcore\.dotnet\sdk\3.1.103\NuGet.targets(123,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-extensions-784b0ffa/nuget/v3/index.json. […\Temp\1gsd3rdo.srb\restore.csproj] […\.nuget\packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.20213.4\tools\Tools.proj] | ||
The `darc-int-...` feeds in NuGet.config are used only when building internally and are not needed after the tags are created. Delete all such entries in the file and retry. | ||
|
||
## Warning: Requested Microsoft.AspNetCore.App v… does not exist | ||
|
||
You have likely attempted to build projects or execute tests which require the just-build Microsoft.AspNetCore.App | ||
shared framework. Execute the following to ensure that exists within the `$(DOTNET_ROOT)` folder: | ||
|
||
```powershell | ||
.\build.cmd -projects src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
./build.sh --projects "$PWD/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj" | ||
``` |
Oops, something went wrong.