Начиная с 30.05.2018 мой основной код ASP.NET в Startup.cs
public IServiceProvider ConfigureServices(IServiceCollection services)
{
// Add services to the collection.
services.AddMvc();
}
бросить исключение, как показано ниже:
Произошла ошибка при запуске приложения. KeyNotFoundException: данный ключ отсутствовал в словаре.
KeyNotFoundException: данный ключ отсутствовал в словаре. System.Collections.Generic.Dictionary.get_Item (ключ TKey) Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider + CandidateResolver.ComputeClassification (строковая зависимость) Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider + CandidateResolver.ComputeClassification (строковая зависимость) Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider + CandidateResolver.ComputeClassification (строковая зависимость) Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider + CandidateResolver.ComputeClassification (строковая зависимость) Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider + CandidateResolver + d__4.MoveNext() System. Linq.Enumerable + d__17.MoveNext() System.Linq.Enumerable + WhereSelectEnumerableIterator.MoveNext() Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager (службы IServiceCollection) Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcC (службы IServiceCollection). Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc (службы IServiceCollection) MyWebApiProject.Startup.ConfigureServices (службы IServiceCollection) в Startup.cs System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Microsoft.AspNetCore.Hosting.ConventionBasedStartup. ConfigureServices (службы IServiceCollection) Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
csproj
<TargetFramework>net461</TargetFramework>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.6.2" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Server" Version="0.2.0-preview2-22683" />
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.1.5" />
<PackageReference Include="Microsoft.VisualStudio.SlowCheetah" Version="3.0.61" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.5" />
<PackageReference Include="System.Net.Http" Version="4.3.3" />