Bug ? Files are automatically marked as modified in the IDE with some Windows Forms

T

TheSteph

Using : VS 2005, .NET 2.0, Windows Form, Win 2k

I have a strange problem in VS : When I open some forms all the files
(resx and cs) of this form are immediately marked as modified (an *
following the file name in the tab of the IDE). So if I open one these form
and immediately close it, VS ask me if I want to save the changes.and that's
quite annoying because in some case I'm not sure if I modified the file or
if it's VS that did it.

After a few research : it happens only with some forms (always the same
forms) - it happens only when the form designer is opened (not when opening
a code file) and in the first second of opening - the Form.Designer.cs files
show that ALL the content of the InitializeComponent() method is rewritten
(a yellow line in the left margin show that).

Does anybody know a solution to that problem, what happens ? Is this a
known bug ?

Thanks !

Steph.
 
F

Frans Bouma [C# MVP]

TheSteph said:
Using : VS 2005, .NET 2.0, Windows Form, Win 2k

I have a strange problem in VS : When I open some forms all the
files (resx and cs) of this form are immediately marked as modified
(an * following the file name in the tab of the IDE). So if I open
one these form and immediately close it, VS ask me if I want to save
the changes.and that's quite annoying because in some case I'm not
sure if I modified the file or if it's VS that did it.

After a few research : it happens only with some forms (always the
same forms) - it happens only when the form designer is opened (not
when opening a code file) and in the first second of opening - the
Form.Designer.cs files show that ALL the content of the
InitializeComponent() method is rewritten (a yellow line in the left
margin show that).

Does anybody know a solution to that problem, what happens ? Is
this a known bug ?

I've seen this too. It happens due to the fact that the form
re-generates the InitializeComponent method again. If you this: copy
the .cs file, then open the form in the designer, then do a diff, using
your favorite diff tool, between the copy and the live file you'll see
there are changes in the initializecomponent method which are very
tiny, e.g.: some lines are swapped, or a space is introduced here and
there. It only happens with some controls not with all of them. (Tab
control comes to mind)

It's still annoying though. It's also the reason why some usercontrols
dissapear when you build a form. For this a hotfix is made, however
that's not publically available (because, why would we want a fix for a
very annoying problem, eh? )

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
T

TheSteph

Thanks for your reply. now I know that's not me !



I also tried to find some differences is the cs files with a file comparing
tool, but I find nothing different.. So I'll wait (and wait and wait.) for
the SP1.



Sometime I've also some forms that opens totally empty in VS.. no more
controls in it and it have it's default size like a new form (but everything
in the cs files is still there.). so once again. I'll wait the SP1.



Steph.
 
T

TheSteph

Thanks for your reply. now I know that's not me !



I also tried to find some differences is the cs files with a file comparing
tool, but I find nothing different.. So I'll wait (and wait and wait.) for
the SP1.



Sometime I've also some forms that opens totally empty in VS.. no more
controls in it and it have it's default size like a new form (but everything
in the cs files is still there.). so once again. I'll wait the SP1.



Steph.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top