Error "The name "Initializecomponent" does not exist in the current context" in every Xamarin project.

Asked

Viewed 484 times

1

Out of nowhere, ALL my projects are making the mistake

The name "Initializecomponent" does not exist in the current context (CS0103)

When created. I don’t need to change anything, the error comes for free.

From what I researched, I tried to fix cleaning the solution, recovering nuget packets and recompiling, but it’s going nowhere!

Error image:

What can I do?

  • Out of nowhere or related to your previous question?

  • I believe it has nothing to do with my previous question because I started a new project and in another directory. But yes, it happened after what happened in my previous question. What is working for me is to give Ctrl c Ctrl v in the folder of another empty project that I have here that is not generating any error, but if I actually go in VS and create a new project, this error in question happens.

  • Create a new project and see if an error appears in the error list tab

  • New project created now: https://i.imgur.com/4YlgqhF.png

  • How are your shampoos? In Build action properties, are they embeded or Compile? How are you creating the project, Shared or . Net Standard?

  • Sorry, how/where I check the build action properties?

  • If you right click on the XAML file appears the option "Run Custom Tool"?

  • If you are referring to this: https://i.imgur.com/djZLGDY.png, then do not...

  • Well, I went to Mainpage.xaml properties, changed the Build Action to C# Compiler, and then went back to Resource Entered and the error was gone. I recompiled to be sure and really disappeared... I’m confused.

  • I tested what I did above with all the other projects that were bugged and worked.

Show 5 more comments

1 answer

0

Problem must be Xamarin.Forms, you have to outdate the nuget of Xamarin.forms. Usually when there are new updates my project has the same error. I can resolve to depress Xamarin.Forms to the previous version and reopen the project.

  • In the last 2 comments above I did a strange procedure that solved...

  • Ok. But if you have the same problem again. Try that most of the time that’s the problem and it’s faster.

Browser other questions tagged

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