3

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.

Community
  • 1
  • 1
Sam
  • 1,384
  • 2
  • 20
  • 30
  • Your second link suggests this is "expected behavior" (not that i condone this, or even know if it is true) - eg net 4.6 throws and swallows this exception on windows 7 currently. The author of that bug latter concedes the actual app crash issue he had was unrelated – Steve Sep 07 '15 at 11:29
  • This is an expected exception when you run on an older version of Windows. It is harmless, a try/catch ensures that it doesn't terminate the program. You will see it in the IntelliTrace window. You have not yet found the real reason you have this problem. – Hans Passant Sep 07 '15 at 11:29
  • Core CLR issue - see https://github.com/dotnet/coreclr/issues/974 – CAD bloke Sep 18 '15 at 02:09
  • @CADbloke Thanks for info, it prove that this exception transparent for program execution, moreover I meet this exception several times again last time. But when I first time saw this exception, it seriously confused me :) – Sam Sep 18 '15 at 09:26
  • Confused me too. I saw it in a WPF app & thought "WHAT NOW"? As if WPF isn't fragile enough. :/ – CAD bloke Sep 18 '15 at 09:38

1 Answers1

1

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.

Sam
  • 1,384
  • 2
  • 20
  • 30