0

我正在尝试在 Win 2003 R2 64 位服务器上安装包含普通 .Net 程序集的 WMI 事件,但我总是收到此错误:

System.IO.FileNotFoundException:找不到文件“C:\WINDOWS\system32\WBEM\Framework\root\MyApp\WMIEvents\Common\MyApp.MyModule.WmiEvents_SN__Version_1.0.53.0.mof”。

  • 我的用户是管理员
  • 我在具有完整权限的命令提示符下运行 InstallUtil
  • 我正在运行 64 位 InstallUtil

我在这里没有选择,欢迎任何帮助......

完整的 InstallUtil 输出如下:

D:\Hosts\web\bin>c:\WINDOWS\microsoft.net\Framework64\v2.0.50727\InstallUtil.exe /i MyApp.MyModule.WmiEvents.dll /showcallstack
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
Copyright (c) Microsoft Corporation.  All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.dll assembly's progress.
The file is located at D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.InstallLog.
Installing assembly 'D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.dll'.
Affected parameters are:
   i =
   assemblypath = D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.dll
   logfile = D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.InstallLog
   logtoconsole =
Installing WMI Schema: Started

An exception occurred during the Install phase.
System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\system32\WBEM\Framework\root\MyApp\WMIEvents\Common\MyApp.MyModule.WmiEvents_SN__Version_1.0.53.0.mof'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path, Boolean detectEncodingFromByteOrderMarks)
   at System.Management.Instrumentation.SchemaNaming.get_Mof()
   at System.Management.Instrumentation.ManagementInstaller.Install(IDictionary savedState)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at System.Configuration.Install.AssemblyInstaller.Install(IDictionary savedState)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)

The Rollback phase of the installation is beginning.
See the contents of the log file for the D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.dll assembly's progress.
The file is located at D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.InstallLog.
Rolling back assembly 'D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.dll'.
Affected parameters are:
   i =
   assemblypath = D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.dll
   logfile = D:\Hosts\web\bin\MyApp.MyModule.WmiEvents.InstallLog
   logtoconsole =

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.

D:\Hosts\web\bin>

更新 我一直在用 procmon 浏览,似乎 installutil 正在尝试打开该文件。

4

2 回答 2

1

如果您尝试安装使用 WMI.net 的 WMI 提供程序,请尝试使用 /mof 开关。这可能会给你更多信息。这将帮助您调试。

http://msdn.microsoft.com/en-us/library/bb608336(v=vs.90).aspx

于 2012-01-30T20:56:27.770 回答
0

似乎 WMI 数据库以某种方式损坏了,我最终删除了我的应用程序的整个架构(首先我尝试仅删除类),然后 installutil 执行完成而没有错误。

如何删除已发布的 wmi 架构?

于 2012-01-31T17:23:35.533 回答