Error: The name 'InitializeComponent' does not exist in the current context

pnet1pnet1 USMember ✭✭✭✭
edited October 21 in Xamarin.Forms

I got started in a new Company. I have some mobile projects in Xamarin.Forms. When i went run a project, i got this error
The name 'InitializeComponent' does not exist in the current context

All projects are not MVVM. All Code, buttons, stacklayout are in the Code Behind. It's ugly Code, too large. How can i solve this issue? It seems a reference issue, but i do not getting to fix.

I use Visual Studio for Mac 2019

Tagged:

Best Answer

  • pnet1pnet1 US ✭✭✭✭
    Accepted Answer

    I changed Build action from Compile to EmbbedCompile and that issue fixes, but i got this new erro

    Error CS0246: The type or namespace name 'Sucesso' could not be found (are you missing a using directive or an assembly reference?)

Answers

  • pnet1pnet1 USMember ✭✭✭✭
    Accepted Answer

    I changed Build action from Compile to EmbbedCompile and that issue fixes, but i got this new erro

    Error CS0246: The type or namespace name 'Sucesso' could not be found (are you missing a using directive or an assembly reference?)

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited October 21

    What's the 'Sucesso'? The plugin class or custom class? For plugin class, you need to install the nuget package.
    For custom calss, have you added the reference?

    Check the Tutorial about the error:
    https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0246

Sign In or Register to comment.