Click here to Skip to main content
14,978,175 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In the project I am using same namespace . Still I am getting error Can't convert one namespace to another. I have tried the below code . Please someone help me on this where I am doing wrong.
Thank you in Advance.

What I have tried:

LogMessage(
               (OFXPresentation.Common.Resources.LogMessageSeverityLevels)Enum.Parse(typeof(OFXPresentation.Common.Resources.LogMessageSeverityLevels), severityLevel.ToString()),
             module, message);
Posted
Updated 21-Jun-21 1:44am

1 solution

Check your code: when I copy'n'paste yours in:
C#
            OFXPresentation.Common.Resources.LogMessageSeverityLevels severityLevel = OFXPresentation.Common.Resources.LogMessageSeverityLevels.a;
            string  module = "module", message = "message";
            LogMessage(
               (OFXPresentation.Common.Resources.LogMessageSeverityLevels)Enum.Parse(typeof(OFXPresentation.Common.Resources.LogMessageSeverityLevels), severityLevel.ToString()),
             module, message);
...
        private void LogMessage(OFXPresentation.Common.Resources.LogMessageSeverityLevels lmsl, string mod, string mess) { }

C#
namespace OFXPresentation.Common.Resources
    {
    public enum LogMessageSeverityLevels
        {
        a, b
        }
    }
I get no error at compile time or run time.
   
Comments
Gita Padhihari 21-Jun-21 9:29am
   
Thank you OriginalGriff .. It worked .. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900