Solved

Problem with changing the Namespace of a Windows form

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now