您的位置:首页 > 其它

【已解决】Windows Service 问题System.IO.FileNotFoundException: 未能加载文件或程序集“file:///”或它 的某一个依赖项。系统找不到指定的文件。。

2016-12-24 23:58 1771 查看
bat文件 内容为

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\

InstallUtil.exe

InstallUtil F:\Windows Services\WindowsServiceTest\WindowsServiceTest_1_0_0_0\WindowsServiceTest.exe

Net Start Service1

pause

其中C:\Windows\Microsoft.NET\Framework\v4.0.30319\为installutil的路径

WindowsServiceTest.exe为Windows Service服务的应用程序,教程

Service1为服务名

ps:.bat与WindowsServiceTest.exe在同一路径

【出现问题】

在初始化安装时发生异常:

System.IO.FileNotFoundException: 未能加载文件或程序集“file:///F:\Windows”或它

的某一个依赖项。系统找不到指定的文件。。

原因:

路径中出现了空格

解决方案:文件放到没有空格的路径

eg:

F:\WindowsServiceTest_1_0_0_0\WindowsServiceTest.exe
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐