Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with changing the Namespace of a Windows form

Posted on 2008-10-16
4
Medium Priority
?
519 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

885 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