Solved

Problem with changing the Namespace of a Windows form

Posted on 2008-10-16
4
513 Views
Last Modified: 2008-10-17
How can I change the Namespace for a Windows form without generating a unhandled Resources exception?

Steps to reproduce the problem
1. In the project application properties dialog box, delete the root namespace field.
2. In the MainForm.vb code file, add "Namespace MyNameSpace" above the Public Class MainForm statement and "End NameSpace" below the End Class statement.
3. In the MainForm.Designer.vb file, add "Namespace MyNameSpace" above the  
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class MainForm statement and "End NameSpace" below the End Class statement.
4. Run Debug

The application compiles without any errors, but execution stops at the "Me.OpenToolStripMenuItem.Image
= CType(resources.GetObject("OpenToolStripMenuItem.Image"), System.Drawing.Image)"
statement in the MainForm.Designer.vb file with the error message:

An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll.  Additional information: Could not find any resources appropriate for the specified
culture or the neutral culture.  Make sure "Acr.UI.MainForm.resources" was correctly embedded or linked into assembly "AcropolisUI" at compile time, or that all the satellite assemblies required are loadable and fully signed.
0
Comment
Question by:ccarneal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 500 total points
ID: 22735298
Right click on "MyNameSpace", in the context menu select "Refactor" > Now select "Rename", a dialog box will pop up with a text box containing name of the namespace, Modify the name and click on Apply button. This should modify the necessary settings for you.
0
 

Author Comment

by:ccarneal
ID: 22735572
When I right clicked on "MyNameSpace," "Refactor" did not appear as one of the options in the context menu.  One of the options that did appear was "Rename..."   When I selected that option and changed "MyNameSpace" to "MyNewNameSpace," the application compiled and ran without any errors.  So, that fixed the problem, and I accept your solution.  But I would like to know what I can do to make "Refactor" appear in the context menu.  Thanks.
0
 
LVL 13

Expert Comment

by:TechTiger007
ID: 22737987
Refactor for VB.NET comes as seperate add-in from microsoft. You can download it here.
http://msdn.microsoft.com/en-us/vbasic/bb693327.aspx
0
 

Author Comment

by:ccarneal
ID: 22741349
I was not able to get Refractor for VB.NET to operate properly, but changing the NameSpace name as described above corrected the problem.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question