Wednesday, January 30, 2019

Visual Studio resources editing support

When you copy-paste .resx resources between projects, mind VS features. Rename copied .resx file to let VS properly fill internals.


VS generates namespace according to folders structure. For case above, it will be TOMEs.Database.Migrations.Migrations._20190128144800.Resources

Don't worry that resource satellite assembly will go to, e.g. TOMEs.Database.Migrations\bin\Debug\cs-CZ\TOMEs.Database.Migrations.resources.dll

Use matching full type name as single constructor parameter for System.Resources.ResourceManager and it will work. Don't try to fool VS by manually editing Designer.cs and substituting some "logically matching" namespaces similar to project from you copied resources.

No comments:

Post a Comment