C
Chris Dunaway
I was working on a Windows Forms app. The main form had a tab control, a
number of tabs with labels and buttons, etc. It is a new project so not
much work has been completed yet.
I added an app.config file to the project and then added appSettings
section to the file as shown below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="KeyName" Value="Value"
</appSettings>
</configuration>
Notice that I forgot to put the closing tag on the <add element.
The result was hundreds of error like the following in the task list:
Code generation for property 'Text' failed. Error was: 'There was an error
loading app.config. Since the document being loaded uses Dynamic
Properties, the config file must be valid. Correct the following error in
app.config:
This is an unexpected token. The expected token is 'NAME'. Line 5, position
9.'
What happened was that the form designer rewrote many many lines of my
InitializeComponent method and many controls disappeared or were changed.
Fortunately, I had checked the code into source control the day before so I
didn't lose anything. But it seems quite a severe reaction on the part of
the form designer to completely re-write the InitializeCode method just
because of a small ommision.
Has anyone else experienced this sort of thing? Are there any articles
availble that describe this issue in more detail?
Making sure the app.config file is correct seems to have fixed the problem.
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
number of tabs with labels and buttons, etc. It is a new project so not
much work has been completed yet.
I added an app.config file to the project and then added appSettings
section to the file as shown below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="KeyName" Value="Value"
</appSettings>
</configuration>
Notice that I forgot to put the closing tag on the <add element.
The result was hundreds of error like the following in the task list:
Code generation for property 'Text' failed. Error was: 'There was an error
loading app.config. Since the document being loaded uses Dynamic
Properties, the config file must be valid. Correct the following error in
app.config:
This is an unexpected token. The expected token is 'NAME'. Line 5, position
9.'
What happened was that the form designer rewrote many many lines of my
InitializeComponent method and many controls disappeared or were changed.
Fortunately, I had checked the code into source control the day before so I
didn't lose anything. But it seems quite a severe reaction on the part of
the form designer to completely re-write the InitializeCode method just
because of a small ommision.
Has anyone else experienced this sort of thing? Are there any articles
availble that describe this issue in more detail?
Making sure the app.config file is correct seems to have fixed the problem.
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.