vb.net System.IO.FileNotFoundException: 无法加载文件或程序集 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\-i
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13174389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\-i
提问by CPM
I am trying to install a web service which is basically a file watcher service. But when I try to run this command Installutil –i "C:\\xxx\zzzz\ServiceTest.exe"
我正在尝试安装一个 Web 服务,它基本上是一个文件观察器服务。但是当我尝试运行此命令时Installutil –i "C:\\xxx\zzzz\ServiceTest.exe"
I get this error System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\-i
我收到这个错误 System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\-i
I used to run this command before and I never got this error, I don't know what is different this time.
我以前运行过这个命令,从来没有出现过这个错误,我不知道这次有什么不同。
回答by John Saunders
Try running
尝试跑步
c:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe -i "C:\xxx\zzzz\ServiceTest.exe"
c:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe -i "C:\xxx\zzzz\ServiceTest.exe"
The response you received doesn't make sense unless "installutil" has been redefined.
除非重新定义了“installutil”,否则您收到的响应没有意义。
回答by youssef Wagih
Check the spelling of the service path specially the (") quote character write it and don't copy paste.
检查服务路径的拼写,特别是 (") 引号字符写它,不要复制粘贴。
This works with me.
这对我有用。
回答by Paulo Henrique Arruda
I get the same error if I download the windows10manager.exe (exe service sample) from the Internet. After I download the file, I go to file properties and I click in unblock button. After this operation, the service install successfuly. To automate this process, follow this thread: Unblock File from within .net 4 c#
如果我从 Internet 下载 windows10manager.exe(exe 服务示例),也会出现同样的错误。下载文件后,我转到文件属性,然后单击取消阻止按钮。此操作后,服务安装成功。要自动执行此过程,请遵循此线程:Unblock File from inside .net 4 c#
回答by TechNovIT
In my case, this error occur because the are some blank spacein my project path e.g.:C:\user\Visual Studio 2019....
就我而言,发生此错误是因为我的项目路径中有一些空格,例如:C:\user\Visual Studio 2019 ....
When I rename my path by deleting space, it worked fine
当我通过删除空格重命名我的路径时,它工作正常
回答by Fernando Silva
I had same problem, because the service name was only "Service.exe", so i change to C:\MyServices\NewService\Service.exe"
我遇到了同样的问题,因为服务名称只是“Service.exe”,所以我更改为 C:\MyServices\NewService\Service.exe”
Wrong: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil /u Service.exe
错误:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil /u Service.exe
Correct: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil /u "C:\MyServices\NewService\Service.exe"
正确:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil /u "C:\MyServices\NewService\Service.exe"
works for me!
对我来说有效!
回答by Razvan Trifan
Change the compiler settings in Visual Studio from X86to Any CPUor use the 64 bit InstalUtil inside "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
将 Visual Studio 中的编译器设置从X86更改为Any CPU或使用 "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" 中的 64 位 InstalUtil
回答by Sebastian Xawery Wi?niowiecki
Maybe some of your refereneced DLLs are still 32bit? You can check it with free tool depends.exe from Microsoft
也许您引用的某些 DLL 仍然是 32 位的?您可以使用 Microsoft 的免费工具 depends.exe 进行检查


