社区
C#
帖子详情
windows服务安装出错的问题!!
myall2002
2003-08-26 10:54:25
用vc.net向导生成一个windows服务server.exe!
用命令 installutil server.exe 安装出错!
出错信息:
在初始化安装时发生异常:
System.IO.FileLoadException:不能运行无法验证的图像“evtrfsrv.exe”。。
...全文
487
8
打赏
收藏
windows服务安装出错的问题!!
用vc.net向导生成一个windows服务server.exe! 用命令 installutil server.exe 安装出错! 出错信息: 在初始化安装时发生异常: System.IO.FileLoadException:不能运行无法验证的图像“evtrfsrv.exe”。。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
panyee
2003-08-26
打赏
举报
回复
不好意思,没做过vc.net的
myall2002
2003-08-26
打赏
举报
回复
它的模板中只提供安装的方法,没有卸载的方法,应该怎样写才对呢?
myall2002
2003-08-26
打赏
举报
回复
to panyee(快乐王子) :
那请问你应该用什么来安装呢?应该怎样才能使用vc.net来做的服务呢?多谢!!
panyee
2003-08-26
打赏
举报
回复
vc.net的服务不是用installutil来安装
vc#.net做的服务可以
csharplove
2003-08-26
打赏
举报
回复
关注
myall2002
2003-08-26
打赏
举报
回复
if (argc >= 2)
{
if (argv[1][0] == _T('/'))
{
argv[1][0] = _T('-');
}
//使用 InstallUtil.exe 安装此 Windows 服务
String* myargs[] = System::Environment::GetCommandLineArgs();
String* args[] ;
AppDomain* dom = AppDomain::CreateDomain(S"execDom");
Type* type = __typeof(System::Object);
String* path = type->get_Assembly()->get_Location();
StringBuilder* sb = new StringBuilder(path->Substring(0, path->LastIndexOf(S"\\")));
if (_tcsicmp(argv[1], _T("-Install")) == 0)
{
args = new String*[myargs->Length-1 ];
sb->Append(S"\\InstallUtil.exe");
args[0] = (myargs[0]);
Array::Copy(myargs, 2, args, 1, args->Length -1);
}
else
{
args = new String*[myargs->Length];
sb->Append(S"\\InstallUtil.exe");
args[0] = S"/u";
args[1] = (myargs[0]);
// Array::Copy(myargs, 2, args, 2, args->Length -2);
}
for( int i = 0 ;i < args->Length ; i++)
Console::WriteLine(args[i]);
dom->ExecuteAssembly(sb->ToString(), 0, args);
}
else
{
ServiceBase::Run(new evTrfSrvWinService());
}
return 0;
OK!!!!!!!
myall2002
2003-08-26
打赏
举报
回复
//若要安装服务,请键入: "server.exe -Install"
int _tmain(int argc, _TCHAR* argv[])
{
if (argc >= 2)
{
if (argv[1][0] == _T('/'))
{
argv[1][0] = _T('-');
}
//使用 InstallUtil.exe 安装此 Windows 服务
String* myargs[] = System::Environment::GetCommandLineArgs();
String* args[] ;
AppDomain* dom = AppDomain::CreateDomain(S"execDom");
Type* type = __typeof(System::Object);
String* path = type->get_Assembly()->get_Location();
StringBuilder* sb = new StringBuilder(path->Substring(0, path->LastIndexOf(S"\\")));
if (_tcsicmp(argv[1], _T("-Install")) == 0)
{
args = new String*[myargs->Length -1];
sb->Append(S"\\InstallUtil.exe");
args[0] = (myargs[0]);
Array::Copy(myargs, 2, args, 1, args->Length -1);
}
if (_tcsicmp(argv[1], _T("-unInstall")) == 0)
{
args = new String*[myargs->Length];
args[0] = S"/u";
args[1] = (myargs[0]);
Array::Copy(myargs, 2, args, 2, args->Length -2);
}
for( int i = 0 ;i < args->Length ; i++)
Console::WriteLine(args[i]);
dom->ExecuteAssembly(sb->ToString(), 0, args);
}
else
{
ServiceBase::Run(new serverWinService());
}
return 0;
}
当使用server.exe -install安装时成功!
但使用server.exe -uninstall卸载时失败!
错误信息:未处理的异常: System.IO.FileLoadException: 访问被拒绝:“v1.1.4322”。
文件名: “v1.1.4322”
请问应该怎样处理??
myall2002
2003-08-26
打赏
举报
回复
哦!!没关系!!
有谁做过的吗??
Oracle11g
服务
器、客户端的
安装
和plsql developer(一次成功)
1.你能保证Oracle11g不出现...你能保证Oracle11g
服务
器
安装
不出现错误吗? 3.你能保证plsql developer不出ORA-12541 TNS 无监听程序错误吗? 4.你知道Oracle11g
安装
服务
器端,客户端,plsql developer都有哪些坑点吗?
windows
10
安装
MongoDB详细教程!!!
第一步需要下载
windows
版本的MongoDB,我这里下载使用的是3.4.3版本,最新版本已经更新到5.x,大家根据需求进行下载部署
安装
官网下载地址:MongoDB Community Downloads | MongoDB 这里滑动找到到对应版本进行...
【C#】
Windows
服务
(Service)
安装
及启停
另一种,写
Windows
服务
;我们现在采用“
服务
方式自启程序”。因为用户不具备管理员权限,为了安全考虑,我们方便监控管理。最终确认方案二。先说说我们面临的
问题
,或者说是待解决的
问题
:①
安装
服务
,通过咱新开发...
windows
下
安装
ssh
服务
器
1、使用openssh。因为在ubuntu下使用apt-get
安装
命令时,就是
安装
openssh。 2、点击:http://www.mls-software.com/opensshd.html#botpage。这里教你怎样
安装
openssh for
windows
。不好找啊!
Windows
安装
oracle 11g出现错误: 启动
服务
出现错误 找不到
服务
OracleMTSRecoveryService的解决方案
Windows
安装
oracle 11g出现错误: 启动
服务
出现错误 找不到
服务
OracleMTSRecoveryService的解决方案 第一步 Ctrl + R —> 输入regedit打开注册表 第二步 在注册表查找HKEY_LOCAL_MACHINE\SYSTEM\...
C#
110,534
社区成员
642,575
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章