title: Failed to resolve assembly for adding custom view in xaml using local tag in xamarin.forms
body: <p>I am developing an application using Xamarin.Forms. Now, I am creating the custom view. But when I render the view in the xaml including namespace, it is giving me "Failed to resolve assembly" error. I looked up on these solutions - <a href="https://stackoverflow.com/questions/36836176/define-xmlns-in-xamarin-forms/36836320#36836320">Define xmlns in Xamarin Forms</a> and <a href="https://stackoverflow.com/questions/37081374/custom-entry-xmlnslocal-error">Custom Entry xmlns:local error</a>. But it is still not working.</p>
  
  <p>This is the CameraPage.xaml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:local="clr-namespace:MementoApp;assembly=MementoApp"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               Padding="0,20,0,0"
               x:Class="MementoApp.Views.CameraPage"&gt;
      &lt;ContentPage.Content&gt;
          &lt;Label Text="Camera Preview:" /&gt;
          &lt;local:CameraPreview Camera="Rear" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>It is in the MementoApp.Views namespace.</p>
  
  <p>I created the CameraPreview.cs in the MementoApp.Views namespace as well. This is the code.</p>
  
  <pre><code>namespace MementoApp.Views
  {
      public enum CameraOptions
      {
          Rear,
          Front
      }
  
      public class CameraPreview : View
      {
          public static readonly BindableProperty CameraProperty = BindableProperty.Create(
              propertyName: "Camera",
              returnType: typeof(CameraOptions),
              declaringType: typeof(CameraPreview),
              defaultValue: CameraOptions.Rear);
  
          public CameraOptions Camera
          {
              get { return (CameraOptions)GetValue(CameraProperty); }
              set { SetValue(CameraProperty, value); }
          }
      }
  }
  </code></pre>
  
  <p>As you can see for the namespace and assembly in xaml, I used</p>
  
  <pre><code>xmlns:local="clr-namespace:MementoApp;assembly=MementoApp"
  </code></pre>
  
  <p>I tried using this as well.</p>
  
  <pre><code>  xmlns:local="clr-namespace:MementoApp.Views;assembly=MementoApp.Views"
  </code></pre>
  
  <p>And this.</p>
  
  <pre><code>xmlns:local="clr-namespace:MementoApp.Views;assembly=MementoApp"
  </code></pre>
  
  <p>All are not working. This is my project structure.</p>
  
  <p><a href="https://i.stack.imgur.com/XDeJx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XDeJx.png" alt="enter image description here"></a></p>
  
  <p>I tried using </p>
  
  <pre><code>xmlns:local="clr-namespace:MementoApp.Views;assembly=Memento"
  </code></pre>
  
  <p>as well. It is not working either.</p>
  
  <p>Why it is not working and how can I fix it?</p>