gpt4 book ai didi

windows-services - installutil 绑定(bind)重定向

转载 作者:行者123 更新时间:2023-12-01 06:47:05 26 4
gpt4 key购买 nike

我有一个依赖于 3:rd 方 API 的 Windows 服务

API 已安装在客户端计算机上的 GAC 中

API 有多个版本(1.0.0.0、1.1.0.0 等)

我的服务适用于所有版本的 API

我在 app.config 文件中使用了 bindingRedirect 标记,该标记在运行服务时可以正常工作。

问题是运行 InstallUtil 时未使用 app.config 文件,因此在注册服务时出现绑定(bind)异常。

目前我使用“sc create”手动注册服务但有更好的方法吗?
(无需编辑 machine.config 等)

最佳答案

我刚遇到这个,我能找到的唯一解决方案是来自 https://connect.microsoft.com/VisualStudio/feedback/details/525564/installutil-exe-does-not-honor-app-config-especially-binding-information :

As a workaround, you might be able to make this work by modifying the InstallUtil.exe.config file to contain the binding information. The InstallUtil.exe.config is installed to %WinDir%\Microsoft.NET\Framework\\InstallUtil.exe.config where is the version of framework you're using.

关于windows-services - installutil 绑定(bind)重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3940120/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com