Solved

Problem with changing the Namespace of a Windows form

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

790 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