C#、Windows服务和Microsoft.Bcl.Async

C#、Windows服务和Microsoft.Bcl.Async,c#,.net,windows,asynchronous,service,C#,.net,Windows,Asynchronous,Service,我正在使用Nuget的Microsoft.Bcl.Async包构建一个C#Windows服务 一切都很好,但当我尝试在机器上安装它时(XP或Win7请尝试在 我认为本页中的第6版正是您需要的。不幸的是,我在这个博客上尝试了第6、7、8和9版。我刚刚在我的全新服务项目构建中再次尝试了第6版,但出现了相同的错误。这只是安装程序的问题吗?也就是说,如果您手动注册,该服务在同一台机器上运行正常吗据我所知,InstallUtil.exe是注册.NET Windows服务的方法。InstallUtil和IS

我正在使用Nuget的Microsoft.Bcl.Async包构建一个C#Windows服务

一切都很好,但当我尝试在机器上安装它时(XP或Win7请尝试在
我认为本页中的第6版正是您需要的。

不幸的是,我在这个博客上尝试了第6、7、8和9版。我刚刚在我的全新服务项目构建中再次尝试了第6版,但出现了相同的错误。这只是安装程序的问题吗?也就是说,如果您手动注册,该服务在同一台机器上运行正常吗据我所知,InstallUtil.exe是注册.NET Windows服务的方法。InstallUtil和ISLE都会引发此错误,因为它使用InstallUtil注册服务。我可以在我的开发盒上安装,如果我在Windows 7计算机上安装.NET 4.5.1,它也会安装得很好。如果有帮助,请替换
RegAsm.exe
InstallUtil.exe
@nosratio,这对InstallUtil.exe有效!之后,我用我的InstallShield生成的安装程序尝试了它,但失败了。FusionLogs显示msiexec.exe仍在寻找System.Threading.Tasks版本1.5.11.0就可以了。同时,我发现InstallShield 2013 LE已经运行了已锁定基本服务安装选项,因此您不必在Windows服务中使用Installer类来安装它。非常感谢所有帮助。:)
*** Assembly Binder Log Entry  (5/1/2014 @ 1:23:13 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = someuser
LOG: DisplayName = System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = InstallUtil.exe
Calling assembly : Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).