Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'MS.Internal.Xaml.Parser.GenericTypeNameParser.TypeNameParserException' in System.Xaml.dll

I am getting this exception now when I am attempting to run my project. I haven't changed any code.

Exception thrown: 'MS.Internal.Xaml.Parser.GenericTypeNameParser.TypeNameParserException' in System.Xaml.dll

Additional information: Prefix 'Custom' does not map to a namespace.

"Custom" refers to the MAHapps metro toolkit in App.xaml:

<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:Custom="http://metro.mahapps.com/winfx/xaml/controls" 
         xmlns:Custom1="http://metro.mahapps.com/winfx/xaml/shared" 

I am not sure why this would change all of the sudden. I updated VS2015 to the latest version and it still won't work.

UPDATE: I put the InitializeComponent() call inside a try catch in an attempt to get the exception object and now the exception is not being thrown.

        try
        {
            InitializeComponent();
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.InnerException.Message);
        }

UPDATE 2: It is still throwing the exception, but "catch (Exception ex)" ignores TypeNameParserException for some reason.

like image 595
Jorb Avatar asked Jan 20 '26 21:01

Jorb


1 Answers

I had this issue in a WPF.NET solution in VS 2022. I had recently turned off "Enable just my code" to debug in the Release configuration. When I switched back to Debug configuration I noticed these errors.

I had to turn "Enable just my code" back on to stop recieving this error.

enter image description here

like image 71
Zodman Avatar answered Jan 23 '26 11:01

Zodman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!