0

Visual Studio2017プレビュー版を使用して個々のユーザーアカウント認証を含む.netコア2.0プレビュー1用の新しいWebプロジェクトを作成しました。私はCMDからそれを実行すると、同じエラーも発生EF移行を実行するとエラーが発生する

System.InvalidOperationException: Unable to configure HTTPS endpoint. For information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. ---> System.Collections.Generic.KeyNotFoundException: No certificate named 'HTTPS' found in configuration for the current environment (Production). 
    at Microsoft.AspNetCore.CertificateLoader.LoadSingle(String certificateName) 
    at Microsoft.AspNetCore.CertificateLoader.Load(IConfigurationSection certificateConfiguration) 
    at Microsoft.AspNetCore.KestrelServerOptionsSetup.<>c__DisplayClass6_0.<BindEndPoint>b__0(ListenOptions listenOptions) 
    --- End of inner exception stack trace --- 
    at Microsoft.AspNetCore.KestrelServerOptionsSetup.<>c__DisplayClass6_0.<BindEndPoint>b__0(ListenOptions listenOptions) 
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure) 
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPAddress address, Int32 port, Action`1 configure) 
    at Microsoft.AspNetCore.KestrelServerOptionsSetup.BindEndPoint(KestrelServerOptions options, IConfigurationSection endPoint, CertificateLoader certificateLoader) 
    at Microsoft.AspNetCore.KestrelServerOptionsSetup.BindConfiguration(KestrelServerOptions options) 
    at Microsoft.AspNetCore.KestrelServerOptionsSetup.Configure(KestrelServerOptions options) 
    at Microsoft.Extensions.Options.LegacyOptionsCache`1.CreateOptions() 
    at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) 
    at Microsoft.Extensions.Options.LegacyOptionsCache`1.get_Value() 
    at Microsoft.Extensions.Options.OptionsManager`1.get_Value() 
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory) 
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer..ctor(IOptions`1 options, ITransportFactory transportFactory, ILoggerFactory loggerFactory) 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider) 
    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) 
    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) 
    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider) 
    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) 
    at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass17_0.<RealizeService>b__0(ServiceProvider provider) 
    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) 
    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) 
    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) 
    at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer() 
    at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() 
    at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() 
    at Test.Program.BuildWebHost(String[] args) in  C:\Users\Test\Documents\Test\src\Test\Program.cs:line 21 
    at Test.Identity.Data.IdentityServiceDbContextFactory.Create(String[] args) in C:\Users\Test\Documents\Test\src\Test\Areas\IdentityService\Data\IdentityServiceDbContextFactory.cs:line 13 
    at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.<>c__DisplayClass10_0.<FindContextTypes>b__3() 
    at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(Func`1 factory) 
    at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType) 
    at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) 
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0() 
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) 
Unable to configure HTTPS endpoint. For information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. 

:私はパッケージマネージャコンソールからアップデート - データベースを実行しようとしたとき

はその後、私は、次のエラーメッセージが表示されました。

これを修正して移行を正常に実行するにはどうすればよいですか?

答えて

1

この問題が発生した場合、.NET Core 2.0プレビュー1を使用していました。次のリンクhttps://docs.microsoft.com/en-gb/aspnet/core/security/httpsでこれを解決する方法と思われるいくつかの提案を行った後でも、私はまだ同じエラーが発生しています。

終わりに私はに、.NETのコア2.0のプレビュー2にアップグレードすることを決定し、今では魔法のように動作します:)

https://blogs.msdn.microsoft.com/dotnet/2017/06/28/announcing-net-core-2-0-preview-2/

関連する問題