Skip to content

Reading dynamic ErrorMessages from resource file #3

@smurugavel

Description

@smurugavel

First, great work on getting this accomplished for angular-agility. Though everything works as expected for AA, I am trying to get localized error messages from resource file.

The error is noticed in loading resource file.
It fails to load the resource file on the GetObjectType method. I also noticed, assemblyNames array has one null item instead of resource file name.

Error: {"Value cannot be null.\r\nParameter name: assemblyString"}

is there a working sample for resource file?

public class TypeHelper { public static Type GetObjectType(string objectName, bool isNameFullyQualified, string alternateNamespace, params string[] assemblyNames) { Type type = null;
        AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve;
        AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve;

        foreach (var asmName in assemblyNames)
        {
            var assembly = Assembly.Load(asmName);
            type = GetTypeFromAssembly(assembly, objectName, isNameFullyQualified, alternateNamespace);
        }

        return type;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions