question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error XFC0000: Cannot resolve type "shades:Shadows"

See original GitHub issue
  • Sdk version: iOS 11/Android SDK 21
  • Xamarin.Forms: 4.8+

I installed the NuGet and added a shadow to a label, but got the next compilation error on build:

Error XFC0000: Cannot resolve type “shades:Shadows”

Steps to reproduce the behavior:

  1. Install nuget
  2. Add shadow namespace inside xaml
  3. Add shadow
  4. Try to build
  5. See error

Source of the page:


<?xml version="1.0" encoding="utf-8"?>
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:shades="http://sharpnado.com"
    x:Class="FailsInShadowsNuget.MainPage">
        <shades:Shadows>

            <Label FontSize="16" Padding="30,24,30,0">
                <Label.FormattedText>
                    <FormattedString>
                        <FormattedString.Spans>
                            <Span Text="Learn more at " />
                            <Span Text="https://aka.ms/xamarin-quickstart" FontAttributes="Bold" />
                        </FormattedString.Spans>
                    </FormattedString>
                </Label.FormattedText>
            </Label>
        </shades:Shadows>
</ContentPage>


Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
roubachofcommented, Oct 29, 2020

thanks to @pictos here is the deal:

To consume types from the custom namespace schema, the XAML compiler requires that there’s a code reference from the assembly that consumes the types, to the assembly that defines the types. This can be accomplished by adding a class containing an Init method to the assembly that defines the types that will be consumed through XAML:

from: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/custom-namespace-schemas#consuming-a-custom-namespace-schema

So for the namespace schema to work, you need to call initializer from App.xaml.cs like this:

        public App()
        {
            InitializeComponent();

            Sharpnado.Shades.Initializer.Initialize(false);
            Sharpnado.Tabs.Initializer.Initialize(true, true);
        }
4reactions
themronioncommented, Oct 23, 2020

@byme8 xmlns:shades=“http://sharpnado.com” - change this to xmlns:shades=“clr-namespace:Sharpnado.Shades;assembly=Sharpnado.Shadows”

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET MAUI Library: XamlC error XFC0000: Cannot Resolve ...
Attempt to build the project. If the problem exists, an XamlC error XFC0000: Cannot resolve type error will be reported in the VS...
Read more >
XamlC error XFC0000: Cannot resolve type
When changing a xaml file, the following error comes up ( see screenshot for full list ). XamlC error XFC0000: Cannot resolve type...
Read more >
XamlC error XFC0000 : Cannot resolve type <type>
Hi Upgraded Xamarin solution to MAUI using upgrade wizard. I am getting two errors; In App.xaml it gives 'XamlC error XFC0000 : Cannot...
Read more >
Multiple XamlC error XFC0000: Cannot resolve type XYZ ...
Hello, I'm experiencing multiple "cannot resolve type" errors with the DX Xamarin controls. They do NOT prevent compilation, but they are a.
Read more >
Error XFC0000 in UI for .NET MAUI
When using the Telerik for MAUI libraries and trying to compile for a Windows device, the error occurs: Error XFC0000 Cannot resolve type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found