Windows Develop Bookmark and Share   
 index > Windows Forms General > User controls with wrong namespace
 

User controls with wrong namespace

When I am using the WinForms designer with a few user controls, I notice that each time I go into the design view, then try to compile my application, the .Designer.cs file can't can't compile because it can't seem to find the class. But when I remove the default namespace value from the namespace of the usercontrol, the class can then be found and the form will compile.

Example...

Project Default namespace as defined in proj file: OrderEntry

Namespace of an offending user control: OrderEntry.frmMainUserControls.Customer

.Designer.cs class definition:

Works:

this.customerOrders = new frmMainUserControls.Customer.CustomerOrders( );

Changes to after viewing form in designer ( Does not compile ):

this.customerOrders = new OrderEntry.frmMainUserControls.Customer.CustomerOrders( );

Russ Harding  Thursday, June 15, 2006 8:47 PM

You made mistake about the forum: tryone of thisbetter, this is only about topics related to Team System:

http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=2&SiteID=1

Luis Fraile  Saturday, June 17, 2006 9:57 PM
Thanks, I'll try over there.
Russ Harding  Tuesday, June 20, 2006 7:47 PM
Misspelled OrderEntry maybe? Double-check the assembly where frmMainUserControls is defined.
JRQ  Tuesday, June 20, 2006 8:02 PM
Its the Visual Studio Designer doing it. I have zero desire to mess around in the .designer.cs file. I let VS handle that. So... if its not likley misspelled.
Russ Harding  Thursday, June 22, 2006 3:50 PM

You can use google to search for other answers

Custom Search

More Threads

• string literals in treeview?
• regarding password protection
• .NET 2.0 Beta 2 - MergeAction and MergeIndex - is it broken?
• Segoe UI
• 1st node in TreeView gets automatically selected when returning to form
• Default Selected Item In A Combo Problems
• Tooltip disappears intermittently
• Adding Pages on HandleCreated event
• How to remove space for icons in MenuStrip
• How do I change/override the DateTimePicker's Internal Selection