更改 web.config 会导致 WCF 服务关闭吗?
我有一个托管在 IIS 上的简单 WCF 服务。每当我更改 web.config 文件时,服务都会关闭并显示以下错误:
无法加载文件或程序集 'AutoMapper,版本=1.1.0.188, 文化=中立, PublicKeyToken=be96cd2c38ef1005' 或 它的依赖项之一。登录 失败:用户名未知或错误 密码。 (HRESULT 的异常: 0x8007052E)
要更正它,我需要删除所有现有文件并重新发布 WCF 服务。重新发布而不删除旧文件不起作用,重新启动iis服务器也不起作用。
有谁知道为什么会发生这种情况?或者是否有其他方法可以重新发布服务以将其恢复?我在 Windows Server 2003(我认为是 6.0)和 .Net Framework 4.0 上使用 IIS
进一步错误信息...
程序集加载跟踪:以下内容 信息可以帮助 确定装配原因 'AutoMapper,版本=1.1.0.188, 文化=中立, PublicKeyToken=be96cd2c38ef1005' 可以 未加载。
WRN:程序集绑定日志记录是 关闭。启用程序集绑定 失败记录,设置注册表 价值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) 到 1。 注意:有一些 与相关的性能损失 程序集绑定失败日志记录。转动 关闭此功能,删除注册表 价值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
堆栈跟踪:
[FileLoadException:无法加载 文件或程序集'AutoMapper, 版本=1.1.0.188,文化=中立, PublicKeyToken=be96cd2c38ef1005' 或 它的依赖项之一。登录 失败:用户名未知或错误 密码。 (HRESULT 的异常: 0x8007052E)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName 文件名、字符串代码库、证据 程序集安全性、运行时程序集 locationHint、StackCrawlMark& 堆栈标记,布尔值 throwOnFileNotFound,布尔值 用于自省,布尔值 抑制安全检查)+0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName 文件名、字符串代码库、证据 程序集安全性、运行时程序集 locationHint、StackCrawlMark& 堆栈标记,布尔值 throwOnFileNotFound,布尔值 用于自省,布尔值 抑制安全检查)+39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName 装配参考、证据 assemblySecurity、StackCrawlMark& stackMark,用于自省的布尔值, 布尔抑制安全检查)+132
System.Reflection.RuntimeAssembly.InternalLoad(字符串 汇编字符串,证据 assemblySecurity、StackCrawlMark& stackMark,用于自省的布尔值) +144 System.Reflection.Assembly.Load(字符串 汇编字符串)+28
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(字符串 构造函数字符串,Uri[] 基本地址)+208
System.ServiceModel.HostingManager.CreateService(字符串 规范化虚拟路径)+1440
System.ServiceModel.HostingManager.ActivateService(字符串 规范化虚拟路径)+44
System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串 规范化虚拟路径)+615[ServiceActivationException: 服务 '/服务/ClientLoginService.svc' 由于以下原因无法激活 编译过程中出现异常。这 异常消息是:无法加载 文件或程序集'AutoMapper, 版本=1.1.0.188,文化=中立, PublicKeyToken=be96cd2c38ef1005' 或 它的依赖项之一。登录 失败:用户名未知或错误 密码。 (HRESULT 的异常: 0x8007052E).]
System.Runtime.AsyncResult.End(IAsyncResult 结果)+679246
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult 结果)+190
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication 上下文、字符串 路由服务虚拟路径,布尔值 flowContext,布尔确保WFService) +234 System.ServiceModel.Activation.HttpModule.ProcessRequest(对象 发送者,EventArgs e) +355
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,布尔值&同步完成) +75
I have a simple WCF service hosted on IIS. Anytime I change the web.config file the service goes down and shows the following error:
Could not load file or assembly
'AutoMapper, Version=1.1.0.188,
Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' or
one of its dependencies. Logon
failure: unknown user name or bad
password. (Exception from HRESULT:
0x8007052E)
To correct it, I need to delete all existing files and re-publish the WCF service. Re-publishing without deleting old files doesn't work, and neither does restarting the iis server.
Does anyone know why this happens? Or if there is an alternative to republishing the service to bring it back up? I am using IIS on Windows Server 2003, which I think is 6.0, and .Net framework 4.0
Further Error Info...
Assembly Load Trace: The following
information can be helpful to
determine why the assembly
'AutoMapper, Version=1.1.0.188,
Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' could
not be loaded.WRN: Assembly binding logging is
turned OFF. To enable assembly bind
failure logging, set the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog]
(DWORD) to 1. Note: There is some
performance penalty associated with
assembly bind failure logging. To turn
this feature off, remove the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog].Stack Trace:
[FileLoadException: Could not load
file or assembly 'AutoMapper,
Version=1.1.0.188, Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' or
one of its dependencies. Logon
failure: unknown user name or bad
password. (Exception from HRESULT:
0x8007052E)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName
fileName, String codeBase, Evidence
assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark&
stackMark, Boolean
throwOnFileNotFound, Boolean
forIntrospection, Boolean
suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName
fileName, String codeBase, Evidence
assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark&
stackMark, Boolean
throwOnFileNotFound, Boolean
forIntrospection, Boolean
suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence
assemblySecurity, StackCrawlMark&
stackMark, Boolean forIntrospection,
Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String
assemblyString, Evidence
assemblySecurity, StackCrawlMark&
stackMark, Boolean forIntrospection)
+144 System.Reflection.Assembly.Load(String
assemblyString) +28
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String
constructorString, Uri[]
baseAddresses) +208
System.ServiceModel.HostingManager.CreateService(String
normalizedVirtualPath) +1440
System.ServiceModel.HostingManager.ActivateService(String
normalizedVirtualPath) +44
System.ServiceModel.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath) +615[ServiceActivationException: The
service
'/Services/ClientLoginService.svc'
cannot be activated due to an
exception during compilation. The
exception message is: Could not load
file or assembly 'AutoMapper,
Version=1.1.0.188, Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' or
one of its dependencies. Logon
failure: unknown user name or bad
password. (Exception from HRESULT:
0x8007052E).]
System.Runtime.AsyncResult.End(IAsyncResult
result) +679246
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult
result) +190
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication
context, String
routeServiceVirtualPath, Boolean
flowContext, Boolean ensureWFService)
+234 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object
sender, EventArgs e) +355
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+148 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously)
+75
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论