简体   繁体   English

用c#.NET 4 vs2010编写的Windows服务不会安装在Server 2008 R2 Enterprise上

[英]windows service written in c# .NET 4 vs2010 will not install on Server 2008 R2 Enterprise

I've written many versions of windows services and installed them on a 64-Bit system with 32 GB running Server 2008 R2 Enterprise. 我已经编写了许多版本的Windows服务,并将它们安装在运行Server 2008 R2 Enterprise的32 GB的64位系统上。

I create the services using this recipe: 我使用这个配方创建服务:
http://msdn.microsoft.com/en-us/zt39148a.aspx http://msdn.microsoft.com/en-us/zt39148a.aspx
"Walkthrough: Creating a Windows Service Application in the Component Designer" “演练:在组件设计器中创建Windows服务应用程序”

I create the .msi and corresponding setup.exe on my Win 7 laptop ( c#, vs2010 SP1, .NET 4 ). 我在Win 7笔记本电脑上创建了.msi和相应的setup.exec#,vs2010 SP1,.NET 4 )。

NORMAL BEHAVIOUR 正常行为

after testing a Windows service on my laptop, I copy the .msi and setup.exe to a folder on the win2008 R2 Enterprise server (using copy and paste via remote desktop); 在笔记本电脑上测试Windows服务后,我将.msi和setup.exe复制到win2008 R2 Enterprise服务器上的文件夹中(使用远程桌面复制和粘贴); I use the server's Control Panel to uninstall, right click the .msi and choose Install, then walk through the Setup Wizard. 我使用服务器的控制面板进行卸载,右键单击.msi并选择Install,然后浏览安装向导。 No problem. 没问题。 Works most of the time. 大部分时间都有效。

ABNORMAL BEHAVIOUR 异常行为

The install runs for perhaps 15 minutes or longer; 安装可能持续15分钟或更长时间; it never finishes; 它永远不会结束; eventually a dialog states 最终一个对话说明
"(?) Installer is no longer responding." “(?)安装程序不再响应。”
with options to [Retry] or [Cancel]. 选项[重试]或[取消]。

At this point, the progress bar is a short as it could possibly be and at the far left, beneath the "P" of "Please wait...". 此时,进度条尽可能短,在最左侧,在“请稍候......”的“P”下方。

Clicking Retry does not help. 单击“ 重试 ”无效。 It's been over 30 minutes and counting since I clicked Retry and the progress bar has not advanced even a pixel. 自从我单击“ 重试”以来,已经过了30多分钟,并且进度条甚至没有提前像素。

MORE INFORMATION 更多信息

(a) the service installs without any problem on another server, a Win 2008 R2 web edition. (a)该服务在另一台服务器上安装没有任何问题,即Win 2008 R2网络版。
(b) as mentioned above, the Windows service both installs and works properly on my Win 7 development and testing environment. (b)如上所述,Windows服务在我的Win 7开发和测试环境中都安装并正常运行。

HISTORY / SPECULATION 历史/猜测

a couple of weeks ago, I was unable to install a service from the win 2008 R2 Enterprise server. 几周前,我无法从win 2008 R2 Enterprise服务器安装服务。 I could not find it in Control Panel/Uninstall even though the .msi claimed it to be installed and the service also continued to appear in the services.msc console. 我无法在控制面板/卸载中找到它,即使.msi声称它已安装,服务也继续出现在services.msc控制台中。 Even disabling the service did not help. 即使禁用该服务也无济于事。 For that reason, I cloned the code, changed the service name slightly, and successfully installed that service which has been running for while without issues. 出于这个原因,我克隆了代码,稍微更改了服务名称,并成功安装已经运行的服务而没有任何问题。

Today, a similar event happened, the only difference being that I can see that service in Control Panel Uninstall. 今天发生了类似的事件,唯一的区别是我可以在控制面板卸载中看到该服务。 Because it would not uninstall, I tried my same cloning trick but this time it failed. 因为它不会卸载,我尝试了同样的克隆技巧,但这次失败了。

Next step: using the above walkthrough, I created a do nothing Windows service and made it useful by importing my client classes into it from the original c# project file. 下一步:使用上面的演练,我创建了一个不做任何Windows服务,并通过从原始c#项目文件导入我的客户端类使其变得有用。

The re-built from the ground up Windows service works as designed on my laptop but refuses to install on the R2 Enterprise server. 从头开始重新构建的 Windows服务按照我的笔记本电脑设计,但拒绝安装在R2 Enterprise服务器上。

Any ideas? 有任何想法吗?

Please and thank you. 谢谢,麻烦您了。

PS: i posted this at so because imho it's more likely something that a developer is likely to encounter prior to handing off her/his code to a sysadmin. PS:我发布了这个,因为imho更可能是开发人员在将她/他的代码交给系统管理员之前可能遇到的问题。

BTW, I could not find anything related at so; 顺便说一句,我找不到任何相关的东西; ditto via Google. 通过谷歌同上。

in this particular case, it is some very weird server rights condition 在这种特殊情况下,它是一些非常奇怪的服务器权限条件

MORE INFORMATION 更多信息

although my server account is not Administrator, I'm a member of both local and domain Administrators for this 2008 R2 box. 虽然我的服务器帐户不是管理员,我是本地和域管理员为此2008 R2箱中的一员。

I had tried many ideas, including creating the example in the walkthrough and trying it. 我尝试了很多想法,包括在演练中创建示例并尝试它。 No luck. 没运气。

The boxe's Administrator was able to install my service using installutil.exe so I tried installutil.exe but it would only work for me using the Administrator's credentials. boxe的管理员能够使用installutil.exe安装我的服务,所以我尝试了installutil.exe,但它只适用于我使用管理员的凭据。

For that reason, I suspected it might be a rights issue, so I tried with my credentials installing the walkthrough example on the H:\\ drive. 出于这个原因,我怀疑它可能是一个权利问题,所以我尝试使用我的凭据在H:\\驱动器上安装演练示例。 Success. 成功。 Next, I tried installing the troublesome Windows service on C: in a different location. 接下来,我尝试在C:上在另一个位置安装麻烦的Windows服务。 Again, success. 再次,成功。

What is strangest about this issue is that many times I had no problem then suddenly a problem arose to block my development efforts. 这个问题最奇怪的是很多次我没有问题然后突然出现了阻碍我的开发工作的问题。

A sign that a Windows service will install is when a dialog asking permission to continue appears almost immediately after starting the install. Windows服务将安装的标志是在开始安装后几乎立即出现要求继续权限的对话框。 Another clue that success is possible is being able to successfully uninstall any previous version via Control Panel. 成功的另一个线索是能够通过控制面板成功卸载任何以前的版本。

I appreciate everyone's efforts to help me with this. 我感谢大家帮助我的努力。 Thank you. 谢谢。

I've had similar experiences with my own MSI's (not just for services), as well as third party MSI's on Win2k3 and Win2k8. 我和我自己的MSI(不仅仅是服务)以及Win2k3和Win2k8上的第三方MSI有类似的经历。 I never (ever) got to the bottom of it without a 'fresh' re-install of the operating system. 如果没有“重新安装”操作系统,我永远不会(无论如何)走到最底层。

Just like you, I too speculate that there's something lost in (a combination or all of) the internals of the OS (registry, file-system, system restore). 就像你一样,我也推测在操作系统的内部(注册表,文件系统,系统还原)中(组合或全部)丢失了一些东西。

I know this is not what you want to hear but (if at all possible) a clean install of the OS might do the trick for you. 我知道这不是你想听到的,但是(如果可能的话)干净安装操作系统可能会对你有所帮助。

暂无
暂无

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

相关问题 C#编码转换为UTF-8-Windows 7与Windows Server 2008 R2的行为不同? - C# encoding conversion to UTF-8 - different behavior on Windows 7 vs. Windows Server 2008 R2? 服务未响应使用Windows Server 2008 R2上的服务控制器的C#程序 - Service not responding to the c# program that uses service controller on windows server 2008 r2 使用C#安装SQL Server 2008 R2 Express - Install SQL Server 2008 R2 Express using C# Windows Server 2008 R2远程服务安装:在C#中进行RDP连接后如何执行程序? - Windows Server 2008 R2 remote service installation: How to execute program after RDP Connection in C#? Windows Server 2008 R2 64位中内置的C#.NET应用程序无法在Windows 7 32位中运行 - C# .NET application built in Windows Server 2008 R2 64bit doesn't run in Windows 7 32bit 如何使用Windows Service(C#)中的多线程在SQL Server 2008 R2中插入和更新同一插入的多条记录? - How to insert & update the same inserted multiple record in SQL Server 2008 R2 using multithread in windows service(C#)? 使用VS2010在安装程序安装过程中安装Windows Service - Install Windows Service during Setup installation using VS2010 在C#.net Windows Server R2中从Excel读取 - Reading from excel in C# .net windows server R2 我的自定义 MSI 不会安装在 Windows 7 或 Windows Server 2008 R2 上 - My custom MSI will not install on Windows 7 or Windows Server 2008 R2 我无法在Windows Azure解决方案的VS2010上安装Facebook C#SDK - I cannot install Facebook C# SDK on VS2010 in Windows Azure Solution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM