MelloPs
MelloPs

Reputation: 135

UWP Initialize components not recognised after clean System.Xaml could not be found

So I got a problem with my UWP project after I cleaned my project... The InitializeComponent() method was no longer recognized and found by Visual Studio, so I was not able to build and so on...

I've been searching the whole day and did'nt find anything helpfull... Also the error message was a charm...

So these where the steps I made before I got the error:

→ The project could not be built because System.Xaml was missing and if I missed an assembly reference... but I never used System.Xaml never and did nether change the references in code file nor did I change the project references

The question was "How to solve this problem?"

So after searching and analyzing the project I noticed that there was a reference to a project in my project references which I've never seen before... It was something like Presentation...

So the solution was to remove this reference and build the project then it worked so if you get this error the only reference you need for it is UniversalWindows and maybe the Microsoft.NetCore.UniversalWindowsPlatform NuGet package.

So remove all and just leave those... If the error disappears add the missing references again... Hopefully this works for you too.

Upvotes: 0

Views: 292

Answers (1)

MelloPs
MelloPs

Reputation: 135

So the solution was to remove this reference and build the project then it worked so if you get this error the only reference you need for it is UniversalWindows and maybe the Microsoft.NetCore.UniversalWindowsPlatform NuGet package.

So remove all and just leave those... If the error disappears add the missing references again... Hopefully this works for you too.

Upvotes: 2

Related Questions