[英]EntryPointNotFoundException in advapi32.dll while starting application
I developing WPF application in Visual Studio 2013 Update 5 on windows 7 x64 SP1. 我在Windows 7 x64 SP1上的Visual Studio 2013 Update 5中开发WPF应用程序。 After starting program download xml-file over http and parse it.
启动程序后,通过http下载xml文件并解析它。 All worked fine until today, and problem is that exception begin occurring suddenly, no significant changes were made in project, no new references were added.
所有工作都很好,直到今天,问题是异常突然发生,项目没有重大变化,没有添加新的参考。
Now while starting program throws System.Windows.Markup.XamlParseException
with message "The method or operation is not implemented" and it occurs even before InitializeComponent()
so no one line of my code executed. 现在,当启动程序时抛出
System.Windows.Markup.XamlParseException
并显示消息“方法或操作未实现” ,它甚至在InitializeComponent()
之前就出现了,所以我的代码没有执行任何一行。 Then I looked into IntelliTrace window in Visual Studio and found a chain of exceptions, top of them is System.EntryPointNotFoundException
with message "Unable to find an entry point named 'EventSetInformation' in DLL 'advapi32.dll'" . 然后我查看了Visual Studio中的IntelliTrace窗口,发现了一系列异常,其中最重要的是
System.EntryPointNotFoundException
,消息“无法在DLL中找到名为'EventSetInformation'的入口点'advapi32.dll'” 。
Searching give me this and this talking that EventSetInformation
is windows 8+ only. 搜索给我这个和这个说话却
EventSetInformation
是Windows 8+只。 So windows 7 missing this method and here is exception, but how could my program reference this method while it (program) is not related to windows 8, not a bit ? 所以Windows 7缺少这个方法,这里是例外,但是我的程序如何引用这个方法,而它(程序)与Windows 8无关, 而不是一点点 ? I can also assume that there is some Update-5-related components inside Visual Studio that can trigger this advapi32 method, but if so - how can I disable this feature?
我还可以假设Visual Studio中有一些与Update-5相关的组件可以触发这个advapi32方法,但如果是这样 - 我该如何禁用此功能?
Edit 编辑
Program using .NET 4.5 使用.NET 4.5编程
Exception info: 例外信息:
System.Windows.Markup.XamlParseException occurred
Message=The method or operation is not implemented.
Source=PresentationFramework
StackTrace:
in System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
Edit2 EDIT2
As Steve and Hans noticed in comments, actual problem finally wasn't related to advapi32 library. 史蒂夫和汉斯在评论中注意到,实际问题最终与advapi32库无关 。 I had a
WindowEx
class derived from Window
with some custom stuff, and my visual window was derived from this WindowEx
. 我有一个从
Window
派生的WindowEx
类,带有一些自定义的东西,我的可视窗口来自这个WindowEx
。 Maybe my custom class missed some method (if to believe exception message), but after switching base class back to Window
and putting custom logic from WindowEx
directly to visual window, error was gone. 也许我的自定义类错过了一些方法(如果要相信异常消息),但在将基类切换回
Window
并将自定义逻辑从WindowEx
直接放到可视窗口后,错误就消失了。
For completeness of this question, here is answer with copy of question's last edit: 为了完整这个问题,这里是问题的最后编辑副本的答案:
As Steve and Hans noticed in comments, actual problem finally wasn't related to advapi32 library . 史蒂夫和汉斯在评论中注意到, 实际问题最终与advapi32库无关 。 I had a
WindowEx
class derived from Window
with some custom stuff, and my visual window was derived from this WindowEx
. 我有一个从
Window
派生的WindowEx
类,带有一些自定义的东西,我的可视窗口来自这个WindowEx
。 Maybe my custom class missed some method (if to believe exception message), but after switching base class back to Window
and putting custom logic from WindowEx
directly to visual window code-behind, error was gone. 也许我的自定义类错过了一些方法(如果要相信异常消息),但在将基类切换回
Window
并将自定义逻辑从WindowEx
直接放到可视窗口代码后,错误就消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.