ERROR: System.Xml.XmlException: 'Name cannot begin with the '<' character, hexadecimal value 0x3C

Charles He-MSFT 96 Reputation points Microsoft Employee

This is a MSDN question asked by Noahi23, the source is ERROR: System.Xml.XmlException: 'Name cannot begin with the '<' character, hexadecimal value 0x3C.

Whenever I try to send a POST request to my API it gives me this error in my WPF application. I've tried to search for "<<<" in my application but there were no results for this. I've been trying to fix this issues for several days, but with no luck.

This is my back-end of my WPF page:
// create new restclient class, with the base url filled in the ()
var client = new RestClient("");

            //  create new restrequest class, withe the rest of the url we want filled in
            var request = new RestRequest("/api/v2/projects");

            string title = Title.Text;
            string description = Description.Text;
            string deadline = Deadline.Text;

            // add the content here: user is automatically created related to the api token, they will be the owner. 
            request.AddBody(new { title = title, description = description, deadline = deadline});

            request.Method = Method.POST;

            request.AddHeader("Accept", "application/json");

            client.AddDefaultHeader("Authorization", string.Format("Bearer {0}", Global.ApiToken));

            // we execute and get the content
            var response = client.Execute(request);

            if (response.StatusCode.ToString() == "OK" || response.StatusCode.ToString() == "200")

            else if (response.StatusCode.ToString() == "422")
                MessageBox.Show("NOT OK");

            else if (response.StatusCode.ToString() == "401")


The front end (XAML):

<UserControl x:Class="Prototype.Projects.ProjectCreate"
             d:DesignHeight="570" d:DesignWidth="830">

    <!-- whole projects grid -->
            <RowDefinition Height="51*" />
            <RowDefinition Height="55*" />
            <RowDefinition Height="Auto" MinHeight="464"/>

            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFA0A0A0" Offset="1" />
                <GradientStop Color="#FFDADADA" />

        <!-- Tab Description -->
        <Grid Row="0">
            <TextBlock Margin="10" FontFamily="Century Gothic" FontSize="25" Text="Nieuw Project" />
        <Grid Row="1">

            <TextBlock Margin="10" FontSize="20" FontFamily="century gothic" TextWrapping="Wrap"
                           Text="Voer hieronder de informatie van het project in" Grid.ColumnSpan="3" />


        <!-- Backlog Items -->
        <Grid Row="2">
                    <Label FontFamily="century gothic" Margin="55,10,4,10">Titel</Label>
                    <TextBox FontFamily="century gothic" Background="White" HorizontalAlignment="right"
                             Margin="0,10,110,10" Width="600" Name="Title" />
                    <Label FontFamily="century gothic" Margin="10,10,38,10">Beschrijving</Label>
                    <TextBox FontFamily="century gothic" Background="White" HorizontalAlignment="right"
                             Margin="0,10,110,10" Width="600" Height="100" TextWrapping="Wrap" Name="Description"/>
                    <Label FontFamily="century gothic" Margin="25,10,20,10">Deadline (2020-01-15 00:00:00)</Label>
                    <TextBox FontFamily="century gothic" Background="White" HorizontalAlignment="right"
                             Margin="0,10,562,10" Width="148" Name="Deadline"/>
                    <!-- -->
                    <Button x:Name="Create_Project_Button" FontFamily="century gothic" VerticalAlignment="Bottom" HorizontalAlignment="Right"
                            Width="250" Margin="0,0,110,13" Click="Create_Project_Button_Click">
                        <TextBlock FontFamily="century gothic">Project aanmaken</TextBlock>
                <!-- -->
                <!-- -->
            <!-- -->
            <!-- -->
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,700 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Li-MSFT 1,096 Reputation points


    Welcome to our Microsoft Q&A platform!

    It may be that some corrupted XML in App.config is causing the issue,see the following link: