sundeep
sundeep

Reputation: 1832

C#.Net automatic resource file designer code generation

In C#.Net when we create a resource file .... Visual Studio generates the designer code for the file automatically. By default the ResourceManager class gets instantiated using the default namespace of the project. Example

[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ISC.Core.UI.DeployResources", typeof(DeployResources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

I want this resource file to be under a custom namespace (say Custom.Default.DeployResources) and not in the default namespace of the project (which in this case is "ISC.Core.UI.DeployResources") Is there a way to achieve this ?

Upvotes: 2

Views: 2598

Answers (2)

Digbyswift
Digbyswift

Reputation: 10410

Could you create a separate project with that default namespace, specifically for resources?

Upvotes: 1

lnu
lnu

Reputation: 1414

Right click on your resx, and type your namespace in Custom Tool Namespace.

You can also change the access modifier from internal to public(at the top of your resx when opened in designer) and put your resources in an external assembly.

Upvotes: 2

Related Questions