gpt4 book ai didi

c# - 无法加载文件或程序集 Microsoft.Practices.ServiceLocation,版本 = 1.3.0.0

转载 作者:太空狗 更新时间:2023-10-29 17:37:41 30 4
gpt4 key购买 nike

这是我在运行我的应用程序 (.NET 4.5) 时遇到的错误:

Server Error in '/' Application.

Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/Austin/Documents/FileStore/FileStore.Web/
LOG: Initial PrivatePath = C:\Users\Austin\Documents\FileStore\FileStore.Web\bin
Calling assembly : Chicago.Security, Version=1.0.5826.21195, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Austin\Documents\FileStore\FileStore.Web\web.config
LOG: Using host configuration file: C:\Users\Austin\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 1.3.0.0 redirected to 1.3.0.0.
LOG: Post-policy reference: Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
Chicago.Security.AuthenticationModule.application_AuthenticateRequest(Object sender, EventArgs e) +0
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

我安装了 nuget 包 CommonServiceLocator,但我仍然收到此错误。奇怪的是,我的 web.config 文件中有一个程序集绑定(bind)重定向,但该程序集没有出现在我的项目的引用列表中,我无法在任何地方找到它来添加它。我对 ASP.NET 还是比较陌生,所以我似乎无法确定到底是什么问题。我发现要尝试的另一件事是在 IIS 管理器中为我的应用程序池将“启用 32 位应用程序”设置为 true,但这并没有解决我的问题。我已经坚持了一段时间,所以任何帮助将不胜感激。

最佳答案

经过数小时的研究和尝试不同的事情,从 Nuget 卸载并重新安装 CommonServiceLocator 似乎可以解决问题。我仍然对 .NET 应用程序及其依赖项的困惑程度感到惊讶。

关于c# - 无法加载文件或程序集 Microsoft.Practices.ServiceLocation,版本 = 1.3.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35435774/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com