Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio show an error about PrismApplication

Tags:

xamarin

prism

Now and then I get XamlC error XFC0000 : Cannot resolve type "PrismApplication" in the error list of my shared xamarin project. The error is from App.xaml and no squiggly is shown in that file, but the error is shown in the error list. Sometimes it goes away if a restart visual studio. I'm running Prism.Unity.Forms v7.2.0.1422. I shoud mention that my android project still builds when the error is shown, but it's annoying and I like to know how to remove it? Maybe it can be done like something like suppressing the error about Ambiguity between 'Resource.Layout.Tabbar' and 'Resource.Layout.Tabbar.

like image 621
Patrick Fransson Avatar asked Jun 17 '26 17:06

Patrick Fransson


1 Answers

I am using Prism with DryIoc (and not unity). Following a suggestion from another thread I replaced

xmlns:prism="http://prismlibrary.com"

with

xmlns:prism="clr-namespace:Prism.DryIoc;assembly=Prism.DryIoc.Forms"

in my App.xaml file and the error disappeared.

I had the same error with PopupPage from Rg.Plugins.Popup, so I also replaced

xmlns:pages="http://rotorgames.com"

with

xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"

and that error disappeared as well.

As these are two different libraries, acting similarly, it might be a general VS issue. But could also be the same error in two libraries.

Another thread lead me to this article which basically says that using a custom namespace requires a direct reference to the assembly through C# code in order for VS to find it and not show this error.

like image 187
Vladimir Avatar answered Jun 21 '26 10:06

Vladimir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!