473,698 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BUG?? App Config and form corruption

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" ?>
<configuratio n>
<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
InitializeCompo nent 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_lunch meat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #1
2 2354
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcg lobal[dot]]net"> wrote in
message news:1r******** *************** *******@40tude. net...
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" ?>
<configuratio n>
<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
InitializeCompo nent 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


Wild. Are any of your controls, either intentionally or unintentionally ,
accessing ConfigurationSe ttings in their constructors or properties? It
sounds like something is, and might need to be "protected" with a test for
Me.DesignMode. I am confused as to why it would actually find/read the
config file at design time, though?

Best Regards,

Andy
Nov 21 '05 #2
On Tue, 17 Aug 2004 10:39:22 -0500, Andy Becker wrote:

Wild. Are any of your controls, either intentionally or unintentionally ,
accessing ConfigurationSe ttings in their constructors or properties? It


Not that I can tell. The xml I posted in my original post was the enitre
app.config file. I had just forgotten to include the closing tag on the
<add> element. That is what caused it.

To me, this is a bug. If the designer detects that the app.config is not
well formed then it should abort the code generation phase and report the
error.

--
Chris

dunawayc[AT]sbcglobal_lunch meat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5634
by: John | last post by:
(access 2002) Anyone have any suggestions as to what may be causing access to not save form changes after I "tell" it to, exit database, then re-open later to discover the changes had not been saved (or somehow reverted). BUT, new form module code is saved. Example: created txtTitle control on form. Create AfterUpdate event code for txtTitle. Save form. Close database. Later...Open database, open form, txtTitle not there but its event...
3
3049
by: Douglas Buchanan | last post by:
Buttons don't work if form is opened on startup A2k If 'frmMain' is set to open by default at startup none of the buttons work. If 'frmMain' is opened from the database window then all the buttons work. The form's name ('frmMain') is selected from in the Startup dialog box.
2
1532
by: lsloan | last post by:
Hi! I have a reoccuring problem with one of my databases where forms will occasionally become corrupted. Since I have backup copies of my production databases, it is easy to recover from using the 'standard' methodology discussed in the various threads that address this issue. However, I would like to prevent the problem from happening in the first place. This has occured to different forms in my database and it strikes
2
2107
by: maddman | last post by:
I have an odd problem with my database, and was hoping someone could point me at the problem. We have an access database that is used by several people to input data. Users have reported some of the records in their forms (Datasheet view) are showing up as "#Deleted", though no one should be deleting records from here. Further, the messages show up only on certain users' screens. Is this a result of corruption from having multiple...
6
2471
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the machine config, this was necessary as our web site has 4 environments and the database server has a different name in each. Since the upgrade the applications can't read the strings in the
2
1330
by: Jeff | last post by:
raggle fraggle and so on Why does this happen? I had just entered some code and when I saved the form, through the menu option, Access nicely shutdown and lost the changes. I know, I should save often, but I was on a roll. But why does it do this. Sometimes when I just close a form in design mode with the close box it does this. Closes the whole instance of Access. Anybody got any ideas as it is so intermittent and I can't find...
23
2567
by: Dave G | last post by:
Since upgrading one of my clients from A97/W2000 to A2003/XP they have suffered no end of data corruption problems, mainly involving one of the main tables. The corruption can result in one record's fields turning into chinese characters. On running the compact/repair I can see that the corruption may be deeper than I expected because sometimes indexes are missing and need to be replaced. I used to think that overuse of 'ctrl-alt-delete'...
4
1342
by: Bob Darlington | last post by:
I have an Access 2002 application with approx 170 forms. Security permissions are controlled via the back end tables. In the front end (mde), the 'Users' group has access to all forms. Yesterday, a client advised that she could not access one form. On checking, I found that all 'Users' group permissions had been removed for that form and that form only. My backups indicate that the change occurred in the last 2 days, and occurred in my...
8
2392
by: Rico | last post by:
Hello, I have a form that seems to corrupt over and over again. I can't open it in design view, usually getting a message like "There isn't enough memory to perform this operation. Close unneeded programs and try the operation again.". I can get to the code but can't seem to do anything to get into design view. The thing I thought about at first was the number of controls on the form; there are about 320 controls, but that is still...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.