Compiler Error Message: CS0433

Asked

Viewed 1,053 times

0

Someone can help me with this mistake, I’m trying to create a profile with Profilecommon

Build Error

Description: Error when compiling a resource needed to meet this request. Examine the specific details of the error and modify the source code appropriately.

Compiler Error Message: CS0433: Profilecommon type exists both in 'c: Users marconibarroso. Appdata Local Temp Temporary ASP.NET Files root e457865f cc134d14 Assembly dl3 f4208480 dca737e7_71d6cf01 CRM Onlline.DLL' as in 'c: Users marconibarroso. Appdata Local Temp Temporary ASP.NET Files root e457865f cc134d14 App_code.ucs9f3oh.dll'

My code

public class ProfileCommon : ProfileBase
{
    public virtual string UserId
    {
        get
        {
            return ((string)(this.GetPropertyValue("UserId")));
        }
        set
        {
            this.SetPropertyValue("UserId", value);
        }
    }

    public virtual string Nome
    {
        get
        {
            return ((string)(this.GetPropertyValue("Nome")));
        }
        set
        {
            this.SetPropertyValue("Nome", value);
        }
    }

    public virtual string TipoPermissao
    {
        get
        {
            return ((string)(this.GetPropertyValue("TipoPermissao")));
        }
        set
        {
            this.SetPropertyValue("TipoPermissao", value);
        }
    }

    public virtual string Email
    {
        get
        {
            return ((string)(this.GetPropertyValue("Email")));
        }
        set
        {
            this.SetPropertyValue("Email", value);
        }
    }
}
  • @Onosendai I think this error can be generated because I have 2 visual studio, 2010 and 2012. They are different applications but both use the same concept! You know something about the error?

  • It seems to me that the two classes have the same identification, @Marconi - same namespace, same name. The compiler cannot decide which to load. I can’t offer a solution without knowing more about the framework in question, but maybe it’s the case that you inherit from the basic class or give it another name.

  • Look I think it would be just that, because I changed the name he ran my project, however he still says that It is not possible to convert an object of type 'Profilecommon' in the type 'Profilecomm'. More at home I’ll see it right.

1 answer

2


Change the class name:

public class MeuProfileCommon : ProfileBase { ... }

Is colliding with the ProfileCommon native to . NET.

  • OK, I’ll try to do it this way. Thank you.

  • 1

    Very good your gypsy response, I am until today in the fight to build a profile, it was for college project. More to do what seems to me that my profile is not getting the settings of the web.Conf, but it’s worth a lot thanks for the help offered here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.