Resource File mystery entries

D

David Laub

Visual Studio .net 2003 automatically creates resx files with three entries
in them. What I don't understand is:

1) sometimes additional entries are automatically placed in the resx file,
and I don't understand what is triggering this. e.g. some of my app
specific objects wind up in the resx file auto-magically.
2) building on 1) above, these additional resources are then referenced in
the cs file InitializeComponent method, which is fine, BUT, sometimes,
completly unrelated web pages will have the same resource references placed
into their InitializeComponent method, resulting in run-time errors. I can
comment out these lines, but, of course, they keep coming back because
InitializeComponent is auto generated. This is a real mystery, and is
driving me crazy!! A code excerpt follows:

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(ClientProfile));

this.htxtWNSTSelectedNodes.TextChanged += new
System.EventHandler(this.htxtWNSTSelectedNodes_TextChanged);

this.htxtWNSTClntID.TextChanged += new
System.EventHandler(this.htxtWNSTClntID_TextChanged);

this.tabCP.TabClick += new
Infragistics.WebUI.UltraWebTab.TabClickEventHandler(this.tabCP_TabClick);

this.btnNextSVD.Click += new System.EventHandler(this.btnNextSVD_Click);

this.GlobalClientName = "XYZ Corp.";

// this.VIMSurplusVehicle =
((VIM.Components.Vehicle.SurplusVehicle)(resources.GetObject("$this.VIMSurpl
usVehicle")));

// this.VIMVehicleRequest =
((VIM.Components.Vehicle.NewVehicle)(resources.GetObject("$this.VIMVehicleRe
quest")));

this.Load += new System.EventHandler(this.Page_Load);

}


Any help would be appreciated!

David Laub
 
D

David Laub

To the curious: I have reposted a revised version of this issue in the
WebControl group, and am still awaiting an "official" response.

To summarize my findings:

In a web Form/Page inherited from the .net supplied Page class, SOMETIMES,
the auto generated code will "fill-in" the public properties from this
inherited class.. The fill-in will be simple string values for simple types
(in the InitializeComponent method), AND serialized objects for reference
types stored in the resx file (e.g. one of the new properties added to the
inherited class returns a collection class) What triggers this auto-fill is
a mystery to be - it can be as little as adding a Command button to a page,
but I can't consistently reproduce it.

A related finding: If you define anything before the Web design Form/Page
class in your cs/vb code file, you WILL have problems. When you define a
class before the "main" class, you get a decent warning that this is a
visual studio no-no. I defined a struct (vs. a class), got no warning, and
everything worked fine - except when the resx resource file started getting
the serialized property values. When I moved my struct to the end of my cs
file, those resource issues disappeared (i.e. run-time resource/culture
matching issues)

But I still don't know what triggers the code generation for these
properties in inherited Web Pages. The code generation is at best (for my
needs) irrelevant, and, at worst, a complete show stopper.

David Laub
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top