Skip to content

Document usage of RootNamespaceAttribute #7434

Closed

Description

@ryanbrandenburg

Requests for new Topics

We should have a short section or paragraph describing what the RootNamespaceAttribute is, when you would use it, and how to include it in your project.

Proposed Contents

When the root namespace of an assembly is different than the assembly name localization does not work by default due to the way resources are searched for within the assembly, and the fact that RootNamespace is a build-time value which is not available to the executing process. If your RootNamespace is different from your AssemblyName then you should include the following in your AssemblyInfo.cs (with values replaced with your actual values):

using System.Reflection;
using Microsoft.Extensions.Localization;

[assembly: ResourceLocation("ResourceFolderName")]
[assembly: RootNamespace("YourRootNamespace")]

This should allow for successful resolution of resx files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions