我的 Windows 服务需要从 Windows 防火墙创建/删除某些规则。为此,我通过 COM与NetFwTypeLib
in进行交互。<windows>\system32\hnetcfg.dll
它在我的 64 位 Windows 7 机器上运行良好,但在另一台 64 位 Windows 7 机器上进行测试会引发以下错误:
Service cannot be started. System.IO.FileNotFoundException:
Could not load file or assembly 'Interop.NetFwTypeLib,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified.
我有一种感觉,如果我在我的应用程序中嵌入和安装程序集,我会遇到不同版本的 Windows 以及 32 位和 64 位之间的问题。
如何解决这个缺少的程序集部署问题?
编辑:这似乎是除 4.0 之外的任何目标框架的VS2010 问题。有没有人可以解决这个问题?