The partial class ClientController had two constructors declared across ClientController.cs and ClientController.Collections.cs. ASP.NET Core DI failed to pick one at request time with: System.InvalidOperationException: Multiple constructors accepting all given argument types have been found in type 'Yavsc.Controllers.ClientController'. Move IHtmlLocalizer<ClientController> into the primary constructor in ClientController.cs and drop the duplicate one in ClientController.Collections.cs. The Collections partial now keeps only its readonly field and action methods; the constructor and field assignment are unified on the main file. Also add the missing 'using Microsoft.AspNetCore.Mvc.Localization;' to ClientController.cs so IHtmlLocalizer resolves.
15 lines
855 B
XML
15 lines
855 B
XML
<Project>
|
|
<!-- Pull in shared package versions from the repository root. -->
|
|
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Packages.props', '$(MSBuildThisFileDirectory)../'))" />
|
|
|
|
<!-- Yavsc.Org.Tests-specific versions -->
|
|
<ItemGroup>
|
|
<PackageVersion Include="Microsoft.AspNetCore.Hosting" Version="2.3.11" />
|
|
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.9" />
|
|
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.9" />
|
|
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.9" />
|
|
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.9" />
|
|
<PackageVersion Include="xunit.v3.common" Version="3.2.2" />
|
|
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.2" />
|
|
</ItemGroup>
|
|
</Project>
|