简体   繁体   English

Windows Service更改其自己的DLL文件

[英]Windows Service changing its own DLL files

I am experiencing an awkward issue with a windows service I have developed. 我开发的Windows服务遇到了一个尴尬的问题。 Suddenly the service started to crash when starting and, after many days of tough research I have found this: some dlls inside the directory in the production server were of a different size than the ones inside the development server. 突然,服务在启动时开始崩溃,经过几天的艰苦研究,我发现:生产服务器目录中的某些dll与开发服务器内部的dll具有不同的大小。 Just for you to know, the process is this: 您只知道,过程是这样的:

  • I develop the service using Visual Studio 2013 in a local Windows 7 machine. 我在本地Windows 7计算机上使用Visual Studio 2013开发该服务。
  • I then compile the service and copy the files generated in the bin/Debug directory into the production server, an Amazon EC2 Machine. 然后,我编译服务并将bin / Debug目录中生成的文件复制到生产服务器(Amazon EC2计算机)中。 (ps: I tried to install the service using the files inside the bin/Release directory but this were of no effect) (ps:我尝试使用bin / Release目录中的文件安装服务,但这无效)

For many weeks, while the windows service worked properly, the files in the production server and those in the development machine were exactly the same, except for some minor differences in the service's .config file. 在Windows服务正常运行的许多星期中,生产服务器中的文件和开发计算机中的文件完全相同,除了服务的.config文件有一些细微差别。 When the problem first appeared I started to see this one difference: many DLL files in the production machine suddenly became swollen, like 3 or 4 times its original size in megabytes. 当问题首次出现时,我开始看到一个区别:生产机器中的许多DLL文件突然膨胀,就像是其原始大小(以兆字节为单位)的3到4倍一样。

Just for you to know, the service uses log4net library for logging procedures. 您只知道,该服务使用log4net库进行日志记录过程。

Any tip? 有小费吗?

You should install a virus/malware scanner. 您应该安装病毒/恶意软件扫描程序。 When nobody changes anything and the dll are changing, your environments is probably compromised. 当没有人更改任何东西并且dll在更改时,您的环境可能会受到威胁。

Problem solved. 问题解决了。 The issue was due to a synchronization service between the two server machines. 该问题是由于两台服务器计算机之间的同步服务所致。 Once I disabled synchronization for the windows service folder, the problem disapeared. 一旦我禁用了Windows服务文件夹的同步,该问题就消失了。

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

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