i have a form that is currently in the wrong namespace:
MyForm.cs:
namespace DirtyHowdoyoudo
{
public MyForm()
{
...
MyForm.Designer.cs:
namespace DirtyHowdoyoudo
{
partial class MainForm
{
The form should be in the namespace Bajingo. What is the proper way to change the namespace of a form?
Note: Editing MyForm.cs to use the new namespace:
MyForm.cs:
namespace Bajingo
{
public MyForm()
{
...
causes the designer to break. i could edit the MyForm.Designer.cs code file manually:
MyForm.Designer.cs:
namespace Bajingo
{
partial class MainForm
{
But i am told by Visual Studio (and SO users – who suggest “use refactor”) not to manually edit the designer file.
Obligatory filler material:
-
i checked the properties window for the form, and there is no
Namespaceproperty:
-
i tried to just rename it, and let the Visual Studio refactor kick in:

Except that Visual Studio wants to rename the namespace everywhere, in everything. i just want this one form.
You may edit the designer file. Stay clear of the region labeled “Windows Form Designer generated code” and you will be fine.