System.IO.FileNotFoundException:' Microsoft.Framework.ApplicationHost'

时间:2015-09-23 21:48:44

标签: oauth asp.net-core

保存用户机密会在Asp .Net 5 beta 7'中引发异常。具体来说,当我执行此语句时:

user-secret set Authentication:Facebook:AppId 1234567890

发生以下异常:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Framework.ApplicationHost' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Framework.ApplicationHost'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.Dnx.Runtime.Loader.LoadContext.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)

这适用于beta 6。有谁知道为什么会发生这种异常以及我需要做些什么来修复它?

1 个答案:

答案 0 :(得分:4)

有一个breaking change。卸载旧的并安装新的。

旧行为:

dnu commands install SecretManager

新行为:

dnu commands install Microsoft.Framework.SecretManager