【问题标题】:deploying windows service make部署windows服务make
【发布时间】:2014-10-23 12:55:53
【问题描述】:

这是我在其上部署 Windows 服务器的服务器的图像

该服务已安装,但是当我运行它时,我得到了这个异常:

Could not start the XXXX service on local computer.
Error 193:0xc1

我不知道我应该给你什么信息,但是你想要什么我可以告诉你

注意

我正在 x86 上构建

App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
some connection strings here ....
  </connectionStrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>

有什么方法可以让我查看该服务的日志吗?

【问题讨论】:

  • 这有帮助吗? fixerrs.com/2014/03/…
  • @Marton 我检查了日志,虽然我使用x86 进行调试,但我得到了service is not a valid win32 application,请问我该怎么办?
  • 您的 SystemDrive 文件夹中是否有一个名为 Program 的文件? (通常是 C:\Program)
  • @Marton 有程序文件,不是程序,有关系吗?
  • 看看如果将“程序”文件重命名为其他文件会发生什么。

标签: c# .net windows sql-server-2008-r2 windows-services


【解决方案1】:
You must have compiled your exe either for .Net 4.5 or for 64-bit architecture (or both). This is the explanation of error code you run into from WinError.h:

// %1 is not a valid Win32 application.
//
#define ERROR_BAD_EXE_FORMAT             193L
Make sure you have compiled it for x86 platform or Any CPU, and whatever version of .Net Framework you compiled against is installed on the machine.

(来自ServiceBase service error 193:0xc1 on Windows XP)。

Windows Embedded 通常不会安装 4.0/4.5 框架(取决于制作映像的人),因此尝试安装框架可能会有所帮助。

注意:Windows Embedded Standard (2009) 是 Windows XP Embedded 的更新版本,是 Windows XP Professional 的完全组件化版本,是 Windows NT 4.0 Embedded 的后续版本。

【讨论】:

  • 我已使用x86 编译,.net 为 4.5。我可以看到这个文件夹C:\Windows\Microsoft.NET\Framework\v4.0.30319 这意味着我安装了.net 4.5 对吗?
  • neowin.net/news/… - 尝试安装,但我会为 4.0 重新编译 - windows Embedded 2009 基于 windows xp - blogs.msdn.com/b/dotnet/p/dotnet45xp.aspx(不支持)。
  • 我已更改为 .net 4,我正在尝试并会更新您
  • 改成4是解决方案YESSSSSSSSSSSS
猜你喜欢
  • 2011-06-12
  • 2010-10-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-08
  • 2012-10-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多