2016-10-23 14 views
3

Visual Studio内でデバッグしようとすると、突然私のWebサイトでこのエラーメッセージが表示されます。ウェブサイトを展開すると、エラーなく動作します。参照アセンブリをロードして実行しないでください。

このエラーを解決するための推奨事項。

 
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Win32.Primitives' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 
    System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 
    System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290 
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +157 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531 

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Win32.Primitives' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261 

答えて

4

あなたのweb.configファイルから

<dependentAssembly> 
    <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> 
    </dependentAssembly> 
+0

をそのセクションを削除してくださいは、私のために働いた... –

+0

@AllmanTool多くのおかげで、あなたは私の一日保存しました。 このセクションを削除する必要がある理由を説明してください。 –

+0

こんにちはChau Than、実際には分かりません:)私はそれをdepencyのリダイレクトとみなしています。私はそのような問題に一度遭遇し、この回答をインターネット上で見つけました – AllmanTool

関連する問題