Tuesday, April 13, 2004

VS.NET and why I could scream rignt now...

Let's get one thing straight right off the bat...I have never used 'Dynamic Properties' in *any* of my WinForms.

Ok...so, there I was, happily coding my business objects and tying them to my user interface. Up to this point, I have used a hard-coded connection string (like you've never done that) in my application.  Today I finally got around to adding my app.config file with the appropriate key for the connection string.  This, it turns out, was a big freakin' mistake.

The user interface was created a few days ago.  One of the forms I created was to be used for searching.  It consisted of a some panels, buttons and a tab control.  Today I was ready to make the form actually work, so I opened the designer for this form to give it a once over before I started adding the glue for the business objects.  After a few seconds, my Task List popped up with about 300 items in it.  I don't recall the exact error, but it had something to do with dynamic properties and the app.config file.  WTF?  The UI looked fine to me, so I double checked my app.config file which also looked fine.

I closed the form and re-opened the designer.  Nothing happended this time, so before starting, I renamed a couple of controls (forgot to change them from the default when first creating the form).  I closed the design view of the form and then I recompiled the app to make sure the new names weren't gonna cause any problems.  No problems compiling the app...

Ok, now here's where the urge to scream starts.  I opened the form in design view again (to see where I should begin adding the "glue") and this time the form was completely screwed up!  The form itself was about 1/4th the size that it should have been, no captions were displayed and all of the controls that weren't Docked were now moved to the far left of the form.  Again I say 'WTF?'.

What the hell did adding an app.config file have to do with my search form?  Time for Google: search for 'app.config dynamic properties' -- 187 hits.  Cool.  After some reading, I discover that if you create dynamic properties, they are stored in the app.config file.  Ok, fine...Did I mention that I *NEVER* used any dynamic properties? 

So, it appears that somehow an app.config file was created and placed in the bin\ folder, but not in the project root.  Why did this happen?  Why did VS.NET allow me to add the new app.config file? 

The pisser of it all is that I did a Bad Thing.  The form hadn't made it to SourceSafe yet, so I am totally screwed.  I now have to recreate this damn form.  I think I'm more pissed about this than the fact that VS.NET did something without me knowing.

This time I'm going to pay attention and try to figure out what the deal with the dynamic properties is.  As soon as the form is created, it's getting checked into VSS. :-\


Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?