XAMLParseException driving me CRAZY!

前端 未结 3 564
故里飘歌
故里飘歌 2021-01-17 23:28

THIS XAMLParseException IS DRIVING ME CRAZY!! I am using .NET 3.5 in Visual Studio 1020 This is my xaml:



        
相关标签:
3条回答
  • 2021-01-17 23:58

    I know that this is an old question but hopefully this will help someone.

    I had a property of the main window that was a Business Object... so when the window initialized, the Business Object attempted to initialize... great, but the Data access layer had not been setup, therefore it threw an error...

    So c# called that an XML parse error because it happened so early... really it was thrown in code.

    0 讨论(0)
  • 2021-01-18 00:05

    I don't think this is really a XamlParseException: I think it's a TargetInvocationException which has gotten wrapped in a XamlParseException. Take a look at the ultimate inner exception:

    NLog.Config.NLogConfigurationException Message=Exception occured when loading configuration from 'C:\Users\Mohit\Documents\Visual Studio 2010\Projects\Notepad\Notepad\bin\Debug\NLog.config'

    It looks like you have a borked configuration file, possibly due to invalid XML or possibly for some more specific reason.

    When you get a mysterious XamlParseException, it's always worth checking the InnerException for a TargetInvocationException (and drilling in from there if there is one). Yes, it is very confusing and misleading!

    0 讨论(0)
  • 2021-01-18 00:07

    Solved the same issue by including the referenced dll and config files in the same folder as the exe file. Trying to run the exe alone will cause a windows level exception.

    0 讨论(0)
提交回复
热议问题