Search code examples
c#wpfvisual-studioxamladvapi32

EntryPointNotFoundException in advapi32.dll while starting application


I developing WPF application in Visual Studio 2013 Update 5 on windows 7 x64 SP1. After starting program download xml-file over http and parse it. 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. 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'".

Searching give me this and this talking that EventSetInformation is windows 8+ only. 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? 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?

Edit
Program using .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
As Steve and Hans noticed in comments, actual problem finally wasn't related to advapi32 library. I had a WindowEx class derived from Window with some custom stuff, and my visual window was derived from this 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.


Solution

  • 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. I had a WindowEx class derived from Window with some custom stuff, and my visual window was derived from this 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.