0
votes

I have a working Xamarin.Forms project that was building fine, when suddenly (after Visual Studio had been closed/reopened, presumably after some update), I started getting the following error:

Failed to resolve assembly: 'MYAPPNAME, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

How do I resolve this error? It doesn't give me a file or location where the problem is, & ProcMon doesn't appear to be helpful either.

1

1 Answers

1
votes

Xamarin.Forms scaffolding apparently will sometimes build a circular assembly reference.

The broken reference will be in one of your XAML files and look like this:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" 
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:local="clr-namespace:MYAPPNAME;assembly=MYAPPNAME"
            ... />

The problem is that at some point Xamarin stuffed in the assembly=MYAPPNAME text.

In some cases, your previously built assembly is either gone/not usable, and therefore this assembly reference is trying to resolve itself before the project is ever built - i.e. it will never work.

Simply remove the bolded text above, save your XAML file, rebuild and everything should be fine - if you still get the same error, you may have other circular reference in other XAML files.

Bug with Xamarin/MSFT pending.