Skip to content

Commit 8218d6e

Browse files
authored
Fix various "Type or namespace not found" errors (#20736)
* Add manual packageReferences where needed * Add more explicit packageRefs * Fix typo * undo changes to blazor.server.js * Fix typo * Don't gen ref assemblies in CodeCheck
1 parent e4b9a28 commit 8218d6e

File tree

45 files changed

+194
-114
lines changed

Some content is hidden

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

45 files changed

+194
-114
lines changed

eng/scripts/CodeCheck.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ try {
165165
& $PSScriptRoot\GenerateProjectList.ps1 -ci:$ci
166166
}
167167

168-
Write-Host "Re-generating references assemblies"
169-
Invoke-Block {
170-
& $PSScriptRoot\GenerateReferenceAssemblies.ps1 -ci:$ci
171-
}
172-
173168
Write-Host "Re-generating package baselines"
174169
Invoke-Block {
175170
& dotnet run -p "$repoRoot/eng/tools/BaselineGenerator/"

src/Antiforgery/src/Microsoft.AspNetCore.Antiforgery.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
88
<PackageTags>aspnetcore;antiforgery</PackageTags>
99
<IsPackable>false</IsPackable>
10+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1011
</PropertyGroup>
1112

1213
<ItemGroup>
1314
<Reference Include="Microsoft.AspNetCore.DataProtection" />
1415
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
1516
<Reference Include="Microsoft.AspNetCore.Http.Extensions" />
1617
<Reference Include="Microsoft.AspNetCore.WebUtilities" />
17-
<Reference Include="Microsoft.Extensions.ObjectPool" />
18+
19+
20+
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="$(MicrosoftExtensionsObjectPoolPackageVersion)"/>
1821
</ItemGroup>
1922

2023
</Project>

src/Components/Server/src/Microsoft.AspNetCore.Components.Server.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<NoWarn>CS0436;$(NoWarn)</NoWarn>
1111
<DefineConstants>$(DefineConstants);MESSAGEPACK_INTERNAL;COMPONENTS_SERVER</DefineConstants>
1212
<IsPackable>false</IsPackable>
13+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1314
</PropertyGroup>
1415

1516
<ItemGroup>
@@ -18,11 +19,12 @@
1819
<Reference Include="Microsoft.AspNetCore.DataProtection.Extensions" />
1920
<Reference Include="Microsoft.AspNetCore.SignalR" />
2021
<Reference Include="Microsoft.AspNetCore.StaticFiles" />
21-
<Reference Include="Microsoft.Extensions.Caching.Memory" />
22-
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
23-
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
24-
<Reference Include="Microsoft.Extensions.Logging" />
25-
<Reference Include="Microsoft.Extensions.ValueStopwatch.Sources" PrivateAssets="All" />
22+
23+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(MicrosoftExtensionsCachingMemoryPackageVersion)"/>
24+
<PackageReference Include="Microsoft.Extensions.FileProviders.Composite" Version="$(MicrosoftExtensionsFileProvidersCompositePackageVersion)"/>
25+
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersion)"/>
26+
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingPackageVersion)"/>
27+
<PackageReference Include="Microsoft.Extensions.ValueStopwatch.Sources" Version="$(MicrosoftExtensionsValueStopwatchSourcesPackageVersion)" PrivateAssets="All" />
2628

2729
<!-- Add a project dependency without reference output assemblies to enforce build order -->
2830
<!-- Applying workaround for https://github.com/microsoft/msbuild/issues/2661 and https://github.com/dotnet/sdk/issues/952 -->

src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<PackageTags>aspnetcore;hosting</PackageTags>
1010
<IsPackable>false</IsPackable>
11+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
1415
<Reference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" />
1516
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
16-
<Reference Include="Microsoft.Extensions.Hosting.Abstractions" />
17+
18+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(MicrosoftExtensionsFileProvidersAbstractionsPackageVersion)"/>
1719
</ItemGroup>
1820

1921
</Project>

src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<PackageTags>aspnetcore;hosting</PackageTags>
1010
<IsPackable>false</IsPackable>
11+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
@@ -20,16 +21,17 @@
2021
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
2122
<Reference Include="Microsoft.AspNetCore.Http.Extensions" />
2223
<Reference Include="Microsoft.AspNetCore.Http" />
23-
<Reference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
24-
<Reference Include="Microsoft.Extensions.Configuration.FileExtensions" />
25-
<Reference Include="Microsoft.Extensions.Configuration" />
26-
<Reference Include="Microsoft.Extensions.DependencyInjection" />
27-
<Reference Include="Microsoft.Extensions.FileProviders.Physical" />
28-
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
29-
<Reference Include="Microsoft.Extensions.Hosting.Abstractions" />
30-
<Reference Include="Microsoft.Extensions.Logging" />
31-
<Reference Include="Microsoft.Extensions.Options" />
32-
<Reference Include="Microsoft.Extensions.TypeNameHelper.Sources" />
24+
25+
<PackageReference Include="Microsoft.Extensions.TypeNameHelper.Sources" Version="$(MicrosoftExtensionsTypeNameHelperSourcesPackageVersion)" />
26+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="$(MicrosoftExtensionsConfigurationFileExtensionsPackageVersion)"/>
27+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion)"/>
28+
<PackageReference Include="Microsoft.Extensions.FileProviders.Composite" Version="$(MicrosoftExtensionsFileProvidersCompositePackageVersion)"/>
29+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="$(MicrosoftExtensionsConfigurationPackageVersion)"/>
30+
<PackageReference Include="Microsoft.Extensions.Options" Version="$(MicrosoftExtensionsOptionsPackageVersion)"/>
31+
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingPackageVersion)"/>
32+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsDependencyInjectionPackageVersion)"/>
33+
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsFileProvidersPhysicalPackageVersion)"/>
34+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(MicrosoftExtensionsFileProvidersAbstractionsPackageVersion)"/>
3335
</ItemGroup>
3436

3537
</Project>

src/Hosting/Server.Abstractions/src/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<PackageTags>aspnetcore;hosting</PackageTags>
1010
<IsPackable>false</IsPackable>
11+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
1415
<Reference Include="Microsoft.AspNetCore.Http.Features" />
15-
<Reference Include="Microsoft.Extensions.Configuration.Abstractions" />
16+
17+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="$(MicrosoftExtensionsConfigurationAbstractionsPackageVersion)"/>
1618
</ItemGroup>
1719

1820
</Project>

src/Http/Authentication.Abstractions/src/Microsoft.AspNetCore.Authentication.Abstractions.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
88
<PackageTags>aspnetcore;authentication;security</PackageTags>
99
<IsPackable>false</IsPackable>
10+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1011
</PropertyGroup>
1112

1213
<ItemGroup>
1314
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
14-
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
15-
<Reference Include="Microsoft.Extensions.Options" />
15+
16+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftExtensionsLoggingAbstractionsPackageVersion)"/>
17+
<PackageReference Include="Microsoft.Extensions.Options" Version="$(MicrosoftExtensionsOptionsPackageVersion)"/>
1618
</ItemGroup>
1719

1820
</Project>

src/Http/Headers/src/Microsoft.Net.Http.Headers.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<PackageTags>http</PackageTags>
1111
<IsPackable>false</IsPackable>
12+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1213
</PropertyGroup>
1314

1415
<ItemGroup>
15-
<Reference Include="Microsoft.Extensions.Primitives" />
16+
<PackageReference Include="Microsoft.Extensions.Primitives" Version="$(MicrosoftExtensionsPrimitivesPackageVersion)"/>
1617
</ItemGroup>
1718

1819
</Project>

src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Microsoft.AspNetCore.Http.HttpResponse</Description>
1414
<PackageTags>aspnetcore</PackageTags>
1515
<NoWarn>$(NoWarn);CS1591</NoWarn>
1616
<IsPackable>false</IsPackable>
17+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1718
</PropertyGroup>
1819

1920
<ItemGroup>
@@ -22,8 +23,9 @@ Microsoft.AspNetCore.Http.HttpResponse</Description>
2223

2324
<ItemGroup>
2425
<Reference Include="Microsoft.AspNetCore.Http.Features" />
25-
<Reference Include="Microsoft.Extensions.ActivatorUtilities.Sources" />
2626
<Reference Include="Microsoft.Net.Http.Headers" />
27+
28+
<PackageReference Include="Microsoft.Extensions.ActivatorUtilities.Sources" Version="$(MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion)"/>
2729
</ItemGroup>
2830

2931
<ItemGroup>

src/Http/Http.Extensions/src/Microsoft.AspNetCore.Http.Extensions.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<PackageTags>aspnetcore</PackageTags>
1010
<IsPackable>false</IsPackable>
11+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
@@ -17,7 +18,8 @@
1718
<ItemGroup>
1819
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
1920
<Reference Include="Microsoft.Net.Http.Headers" />
20-
<Reference Include="Microsoft.Extensions.FileProviders.Abstractions" />
21+
22+
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" Version="$(MicrosoftExtensionsFileProvidersAbstractionsPackageVersion)"/>
2123
</ItemGroup>
2224

2325
</Project>

0 commit comments

Comments
 (0)