InstallUtil 将 WMI 架构发布到 64 位目录而不是 32 位目录
这与这个问题类似,但是看起来还没有确定一个好的解决方案,所以我正在打开一个新的解决方案,其中包含澄清的细节。
我们编写了一个 .NET 服务,其中包括使用 WMI 发布一些类层次结构。在 64 位计算机(运行 Windows 2008 R2 Server)上,我们运行 32 位版本的 InstallUtil 来安装该服务。它安装成功,但是当服务运行时,我们在使用 Instrumentation.Publish() 发布 WMI 类时收到以下错误消息
DirectoryNotFoundException - (找不到路径的一部分 'C:\Windows\system32\WBEM\Framework\root\MyNamespace\MyService'。)
但是,此目录确实存在于 C:\Windows\syswow64 目录中。如果我们手动将该目录结构复制到 system32 目录,则一切正常。 但是,我们正在寻找一种自动化解决方案,因为我们已将其打包在 MSI 中,并将其分发到许多服务器上。
我们尝试运行 64 位版本的 InstallUtil,看看这是否有效,但是...这是非常奇怪的部分...它在安装上给了我们一个错误,上面写着
安装 WMI 架构:已开始
安装阶段发生异常。 System.IO.DirectoryNotFoundException: 找不到路径的一部分 'C:\Windows\system32\WBEM\Framework\root\MyNamespace\MyService.mof'。
看起来似乎 WMI 安装程序发生了翻转。有其他人经历过这种情况,或者知道解决方法吗?
This is similar to this question, but it doesn't look like a good solution was ever determined, so I'm opening a new one with clarified details.
We wrote a .NET service, which among other things, publishes some of the class hierarchy using WMI. On a 64-Bit machine (running Windows 2008 R2 Server), we are running the 32-bit version of InstallUtil to install the service. It installs successfully, but when the service runs, we receive the following error message when publishing a WMI class using Instrumentation.Publish()
DirectoryNotFoundException - (Could not find a part of the path
'C:\Windows\system32\WBEM\Framework\root\MyNamespace\MyService'.)
However, this directory does exist in the C:\Windows\syswow64 directory. If we manually copy that directory structure to the system32 directory, then everything works. However, we are looking for an automated solution, because we have this packaged up in an MSI which we distribute onto many servers.
We have tried running the 64-Bit version of InstallUtil, to see if that would work, however... and this is the really weird part... it gives us an error on install that says
Installing WMI Schema: Started
An exception occurred during the Install phase.
System.IO.DirectoryNotFoundException:
Could not find a part of the path
'C:\Windows\system32\WBEM\Framework\root\MyNamespace\MyService.mof'.
It looks as if somehow, the WMI installer flipped around. Has anyone else experienced this, or know of a work around?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我一直在寻找同一问题的答案。我现在这有点晚了,但对你和其他读者来说。我们发现,当我们使用命令
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe
而不是
C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe 时,它工作正常。
Framework 目录中的 64 是我们遇到的问题。如果您已经解决了您的问题,那么我希望我可以帮助其他人寻找相同问题的答案。
I was looking for an answer for this very same issue. I now this is a bit late but to you and the other readers. We have found that it works fine when we use command
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe
instead of,
C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe.
the 64 on the Framework directory is what tripped us up. If you have already solved your problem, then I hope I helped others searching for an answer to the same problem.
我知道这个响应甚至更晚,但也许它也可能对其他人有帮助 -
我发现如果您从命令行运行安装实用程序,如果您不以管理员身份运行它,您会遇到奇怪的问题,我们有类似的东西并使用“以管理员身份运行”打开命令,问题就消失了。可能无法解决您的问题,但值得一试。
I know this response is even later, but perhaps it may help other people as well -
I found that if you're running the install utility from the command line, if you don't run it as administrator you run into bizarre issues, we had something similar to this and opened up the command using "run as administrator" and the issues evaporated. Might not solve your issue, but worth giving it a try.