How to Resolve Settingsfile File Error

Asked

Viewed 80 times

0

I’m creating a project and in it, I use a theme to look good. When I put the theme, all right, there was no mistake or anything, just today, that gave this problem, and I can not see the Form. The mistake is as follows:

The Settings start tag on line 6 position 4 does not match the end tag of SettingsFile

In case you need the file Settings.Designer I edit the question.

  • 3

    Welcome to Sopt, Brayan. I made an issue of your question in order to make it clearer and within the community standards. I suggest you read the [Ask] and the [tour]. Another thing: - It is always preferable that you put the related code fragment in the question, such as the error returned. Images with codes and errors do not help much (especially if using the mobile phone) :D

1 answer

2


Let’s debug that file as error says in tag Settings, line 6.

  <?xml version="1.0" encoding="utf-8"?>
  <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
     <Profiles>
        <Profile Name="(Default)" />
     </Profiles>
     <Settings> <!-- linha 6 é essa -->
        <Setting Name="HWID" Type="System.String" Scope="User">
            <Value Profile="(Default)" />
        </Setting>
     <Settings /> <!-- Erro aqui, tag não finalizada (wtf é isso?) -->
</SettingsFile> <!-- linha 11 é essa -->

The error is on line 10, where you put <Settings /> rather than </Settings>. Consider this the corrected version:

  <?xml version="1.0" encoding="utf-8"?>
  <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
     <Profiles>
        <Profile Name="(Default)" />
     </Profiles>
     <Settings>
        <Setting Name="HWID" Type="System.String" Scope="User">
            <Value Profile="(Default)" />
        </Setting>
     </Settings>
</SettingsFile>

Always when closing a tag, use </ at the beginning of it, not at the end of it.

  • 1

    it worked! But now it’s giving this error: Unexpected XML declaration. The XML declaration must be the first Node in the Document, and no white space characters are allowed to appear before it. Line 1, position 5.

  • Remove all spaces/characters from new lines from the beginning of your XML file. Could be this, click your up arrow next to the post and the correct sign to consider this answer as correct, will help me a lot!

  • 1

    Thanks, it really worked, but when I click the arrow, the number 1 appears and returns to 0.. When you had answered me by 1° time I did so and again gave such a mistake. But really, thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.