运行Installutil以在共享文件夹上安装Windows服务

ant*_*tar 2 windows-services installutil

-你好,

我试图从共享文件夹安装Windows服务,如下所示:

installutil "\\\10.1.5.120\Path1\Path2\MyService.exe"
Run Code Online (Sandbox Code Playgroud)

有这个错误:

Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file://\\10.1.5.120\Path1\Path2\MyService.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515).
Run Code Online (Sandbox Code Playgroud)

在installutil日志文件中没有日志,当我尝试从本地路径安装服务时,它会成功安装.

所以我想知道是否可以从共享路径在PC上安装Windows服务?

谢谢你的帮助.

dra*_*707 11

你试过添加吗?

<runtime>
   <loadFromRemoteSources enabled="true" />
</runtime>
Run Code Online (Sandbox Code Playgroud)

在installutil.config中的installutil.exe所在的位置?

您也可以尝试右键单击dll和服务exe - > properties - > unblock.