Solved

Problem with changing the Namespace of a Windows form

Posted on 2008-10-16
4
507 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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