警告 - 提供资源不可访问运行wevtutil [英] WARNING -Provider resources not accessible running wevtutil
问题描述
我需要帮助解决尝试创建Windows事件提供程序时无法访问的提供程序资源。我使用ManGen实用程序创建我的清单文件,并将我的'.exe'文件命名为我的消息和资源文件。使用我的exe文件编译'.rc'文件,并生成预期的'.res'文件,但是当我运行wevtutil时,我不断得到'资源不可用'警告。
当您安装清单(例如 wevtutil im manifest.man
)时,应该会看到某种警告资源不可用:
****警告:发布者EventsProvider资源不可访问
要获取一些其他信息,请尝试检索其中一个发布商的信息,例如:
c:\ ...> wevtutil gp< EventProviderName>
,然后在资源查看器中打开您的exe,您应该可以看到资源您应该至少有一个WEVT_TEMPLATE条目。
无法为发布者< EventProviderName>确认,上面提到了一个权限问题,所以让我让路径可以访问,尝试一下。再次:c:\ ...> wevtutil gp< EventProviderName>
无法为发布商< EventProviderName> ;.打开元数据。在图像文件中找不到指定的资源
类型。
对于上述,看起来资源没有正确编译。
如果您使用VS打开
要正确编译资源,
csc
需要如下传递资源:csc /win32res:<Resource.res>
I need help solving the "Provider '' resources not accessible when trying to create a windows event provider. I create my manifest file with the ManGen utility, and name my '.exe' file as my message and resource file. I compile the '.rc' file with my exe file and the expected'.res' file are generated. However, when I run wevtutil I keep getting the 'resources not accessible' warning.
解决方案When you install your manifest (e.g.
wevtutil im manifest.man
), you should see some sort of a warning if the resources aren't available:**** Warning: Publisher EventsProvider resources are not accessible.
To get some additional information, try to retrieve information on one of the publishers. For example:
c:\...> wevtutil gp <EventProviderName> Failed to open metadata for publisher <EventProviderName>. Access denied.
Ok, the above suggests a permissions problem, so let me make the path accessible and try again:
c:\...> wevtutil gp <EventProviderName> Failed to open metadata for publisher <EventProviderName>. The specified resource type cannot be found in the image file.
For the above, it looks like the resource didn't get compiled in correctly.
If you go
File->Open
with VS and open your exe in the resource viewer you should be able to see the resources that were compiled in. You should at least have a "WEVT_TEMPLATE" entry.For the resource to be compiled in correctly,
csc
needs to be passed the resource as follows:csc /win32res:<Resource.res>
这篇关于警告 - 提供资源不可访问运行wevtutil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!