简体   繁体   English

使用新的重定向强名称程序集调试服务

[英]Debugging service with new redirected strong name assemblies

We found a problem with third party assemblies which are strongly named and are used in our windows service. 我们发现第三方程序集存在一个问题,这些程序集具有很强的名称并在Windows服务中使用。

On the client machine, with the already installed release build I dropped in the new assemblies and in the application config file I redirected the services to load the new assemblies. 在客户端计算机上,使用已经安装的发行版版本,我放入了新程序集,并在应用程序配置文件中重定向了服务以加载新程序集。 My service starts but does not seem to do anything (it should start logging as soon as it starts). 我的服务已启动,但似乎什么也没做(它应该在启动后立即开始记录)。

I was wondering if on my development machine I can run my application in Debug and some how use the new assemblies to try to work out where the service is failing? 我想知道是否可以在开发机器上运行Debug中的应用程序,以及如何使用新程序集尝试找出服务失败的地方?

JD 京东

A couple of things you can try: 您可以尝试以下几种方法:

  • To debug the service, try inserting a "System.Diagnostics.Debugger.Break()" in the first line of your OnStart() method 若要调试服务,请尝试在OnStart()方法的第一行中插入“ System.Diagnostics.Debugger.Break()”

  • If you can't change the code, increase the Fusion logging level and then run the service again. 如果您无法更改代码,请增加Fusion日志记录级别,然后再次运行该服务。 Your assembly error should be logged with more details in the Event Viewer. 您的程序集错误应在事件查看器中记录更多详细信息。 Some good instuctions here: How to enable assembly bind failure logging (Fusion) in .NET 这里有一些很好的指导: 如何在.NET中启用程序集绑定失败日志记录(融合)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM