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.

MarkupExtension not found for d:DesignInstance

See original GitHub issue

So I’m trying to use the extension in Rider and I get an exception when I land on a page that has d:DesignInstance.

LiveXAML had a similar issue that they had to fix

The issue goes away if I enable XamlC, however then HotReload quits working.

EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Xamarin.Forms.Xaml.XamlParseException: Position 16:17. MarkupExtension not found for d:DesignInstance
  at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x00359] in D:\a\1\s\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:103 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ac] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:149 
  at Xamarin.Forms.Xaml.ListNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00025] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:226 
  at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00044] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:200 
  at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydrationContext visitorContext, System.Boolean useDesignProperties) [0x00064] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:148 
  at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml, System.Boolean useDesignProperties) [0x00058] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:91 
  at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType) [0x00028] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:69 
  at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.Type callingType) [0x00000] in D:\a\1\s\Xamarin.Forms.Xaml\ViewExtensions.cs:36 
  at MyApp.Mobile.MyProject.Pages.TabNavPage.InitializeComponent () [0x00001] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject/obj/Debug/netstandard2.0/Pages/TabNavPage.xaml.g.cs:21 
  at MyApp.Mobile.MyProject.Pages.TabNavPage..ctor () [0x00013] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject/Pages/TabNavPage.xaml.cs:16 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:698 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:704 
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000a8] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:179 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:153 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/rttype.cs:5646 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00039] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:206 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:190 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:134 
  at MyApp.Mobile.MyProject.Core.Services.Navigation.NavigationService+<>c__DisplayClass19_0.<InitializePage>b__1 () [0x00000] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Services/Navigation/NavigationService.cs:148 
  at MyApp.Mobile.MyProject.Core.Helpers.Performance+<>c__DisplayClass8_0`1[T].<Measure>b__0 () [0x00001] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Helpers/Performance.cs:24 
  at MyApp.Mobile.MyProject.Core.Helpers.Performance.Measure (System.String title, System.Action action, System.String callerName) [0x00019] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Helpers/Performance.cs:36 
  at MyApp.Mobile.MyProject.Core.Helpers.Performance.Measure[T] (System.String title, System.Func`1[TResult] func, System.String callerName) [0x0001a] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Helpers/Performance.cs:22 
  at MyApp.Mobile.MyProject.Core.Services.Navigation.NavigationService.InitializePage (System.String pageKey, MyApp.Mobile.MyProject.Core.Interfaces.IViewModel viewModel, MyApp.Mobile.MyProject.Core.Services.Navigation.NavigationParameters parameters) [0x00089] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Services/Navigation/NavigationService.cs:148 
  at MyApp.Mobile.MyProject.Core.Services.Navigation.NavigationService.NavigateTo (System.String pageKey, MyApp.Mobile.MyProject.Core.Interfaces.IViewModel viewModel, MyApp.Mobile.MyProject.Core.Services.Navigation.NavigationParameters parameters) [0x00045] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Services/Navigation/NavigationService.cs:127 
  at MyApp.Mobile.MyProject.Core.Services.Navigation.NavigationService.NavigateTo (System.String pageKey, MyApp.Mobile.MyProject.Core.Interfaces.IViewModel viewModel) [0x0002d] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject.Core/Services/Navigation/NavigationService.cs:119 
  at MyApp.Mobile.MyProject.ViewModels.MainViewModel.<OnSignInCommand>b__31_0 () [0x00201] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject/ViewModels/MainViewModel.cs:158 
  at MyApp.Mobile.MyProject.ViewModels.BaseViewModel.RunSafeAsync (System.Func`1[TResult] task, System.Action`1[T] handleErrorAction) [0x00041] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject/ViewModels/Base/BaseViewModel.cs:297 . Priority: High. Timestamp:2019-06-28 13:37:02Z.
EXCEPTION: Xamarin.Forms.Xaml.XamlParseException: Position 16:17. MarkupExtension not found for d:DesignInstance
  at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x00359] in D:\a\1\s\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:103 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ac] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:149 
  at Xamarin.Forms.Xaml.ListNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00025] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:226 
  at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00044] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:200 
  at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydrationContext visitorContext, System.Boolean useDesignProperties) [0x00064] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:148 
  at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml, System.Boolean useDesignProperties) [0x00058] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:91 
  at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType) [0x00028] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:69 
  at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.Type callingType) [0x00000] in D:\a\1\s\Xamarin.Forms.Xaml\ViewExtensions.cs:36 
  at MyApp.Mobile.MyProject.Pages.TabNavPage.InitializeComponent () [0x00001] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject/obj/Debug/netstandard2.0/Pages/TabNavPage.xaml.g.cs:21 
  at MyApp.Mobile.MyProject.Pages.TabNavPage..ctor () [0x00013] in /Users/chaseflorell/Projects/MyApp/MyApp.Mobile.MyProject/MyApp.Mobile.MyProject/Pages/TabNavPage.xaml.cs:16 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:698 . Priority: High. Timestamp:2019-06-28 13:37:02Z.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ChaseFlorellcommented, Jul 16, 2019

there’s a lot of custom controls and such in there, sorry 😦 I’ll give you whatever I can though.

<?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:pages="clr-namespace:MyCompany.Mobile.MyProduct.Pages;assembly=MyCompany.Mobile.MyProduct"
                xmlns:helpers="clr-namespace:MyCompany.Mobile.MyProduct.Helpers;assembly=MyCompany.Mobile.MyProduct"
                xmlns:xaml="clr-namespace:MyCompany.Mobile.MyProduct.Xaml;assembly=MyCompany.Mobile.MyProduct"
                xmlns:behaviors="clr-namespace:MyCompany.Mobile.MyProduct.Behaviors;assembly=MyCompany.Mobile.MyProduct"
                xmlns:controlTemplates="clr-namespace:MyCompany.Mobile.MyProduct.Templates.ControlTemplates;assembly=MyCompany.Mobile.MyProduct"
                xmlns:cells="clr-namespace:MyCompany.Mobile.MyProduct.Cells;assembly=MyCompany.Mobile.MyProduct"
                xmlns:converters="clr-namespace:MyCompany.Mobile.MyProduct.Converters;assembly=MyCompany.Mobile.MyProduct"
                xmlns:controls="clr-namespace:MyCompany.Mobile.MyProduct.Controls;assembly=MyCompany.Mobile.MyProduct"
                xmlns:viewModels="clr-namespace:MyCompany.Mobile.MyProduct.ViewModels"
                x:Class="MyCompany.Mobile.MyProduct.Pages.ActivityListPage"
                d:DataContext="{d:DesignInstance d:Type=viewModels:ActivityListViewModel, IsDesignTimeCreatable=True}"
                mc:Ignorable="d" 
                Title="{Binding Title}">
    <pages:BasePage.Resources>
        <ResourceDictionary>
            <converters:TappedItemEventArgsToTappedItemConverter x:Key="TappedItemConverter" />
            <converters:FormattedDateConverter x:Key="FormattedDateConverter" />
        </ResourceDictionary>
    </pages:BasePage.Resources>
    <pages:BasePage.ToolbarItems>
        <ToolbarItem Command="{Binding GoToActivityFilterPageCommand}" >
            <ToolbarItem.IconImageSource>
                <controls:ExFontImageSource FontIcon="{x:Static xaml:Icons.fcc_filter}" Color="{StaticResource White}" Size="20"/>
            </ToolbarItem.IconImageSource>
        </ToolbarItem>
        <ToolbarItem Command="{Binding ShowActivityActionSheetCommand}" >
            <ToolbarItem.IconImageSource>
                <controls:ExFontImageSource FontIcon="{x:Static xaml:Icons.fcc_circle_plus}" Color="{StaticResource White}" Size="20"/>
            </ToolbarItem.IconImageSource>
        </ToolbarItem>
    </pages:BasePage.ToolbarItems>
    <ListView HasUnevenRows="True"
              BackgroundColor="Transparent"
              CachingStrategy="RecycleElement"
              SeparatorColor="{StaticResource SharkWithAlpha}"
              IsPullToRefreshEnabled="true"
              IsRefreshing="{Binding IsBusy}"
              RefreshCommand="{Binding RefreshCommand}"
              ItemsSource="{Binding VisibleDataObjectCollection}">
        <ListView.Behaviors>
            <behaviors:InfiniteLoadBehavior />
            <behaviors:EventToCommandBehavior Command="{Binding ShowDetailsCommand}" 
                                              EventName="ItemTapped"
                                              Converter="{StaticResource TappedItemConverter}" />
        </ListView.Behaviors>
        <ListView.ItemTemplate>
            <DataTemplate>
                <cells:ExViewCell>
                    <controlTemplates:ThreeRowListItemTemplate VerticalOptions="Fill" 
                                                               HorizontalOptions="Fill"
                                                               PrimaryText="{Binding Title}"
                                                               SecondaryText="{Binding MyProductName}"
                                                               TertiaryText="{Binding StartDate, Converter={StaticResource FormattedDateConverter}}" />
                </cells:ExViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
        <ListView.Header>
            <ContentView Padding="3" />
        </ListView.Header>
        <ListView.Footer>
            <Grid>
                <controlTemplates:EmptyDataTemplate Text="{helpers:Translate ActivityListPage_ListEmptyMessage}" 
                                                  IsVisible="{Binding ShowNoDataWarning}">
                    <controlTemplates:EmptyDataTemplate.Triggers>
                        <DataTrigger TargetType="controlTemplates:EmptyDataTemplate" Binding="{Binding IsLoadingPage}" Value="True">
                            <Setter Property="IsVisible" Value="False"/>
                        </DataTrigger>
                    </controlTemplates:EmptyDataTemplate.Triggers>
                </controlTemplates:EmptyDataTemplate>
                <Button Text="{helpers:Translate ActivityListPage_ClearFilter}"
                      Style="{StaticResource TextOnlyButton}"
                      IsVisible="{Binding HasFiltersApplied}"
                      Command="{Binding ClearFiltersCommand}" >
                    <Button.Triggers>
                        <DataTrigger TargetType="Button" Binding="{Binding IsLoadingPage}" Value="True">
                            <Setter Property="IsVisible" Value="False"/>
                        </DataTrigger>
                    </Button.Triggers>
                </Button>
                <ActivityIndicator HorizontalOptions="Center" 
                                   VerticalOptions="Center" 
                                   Color="{StaticResource PrussianBlue}"
                                   IsRunning="{Binding IsLoadingPage}"
                                   IsVisible="{Binding IsLoadingPage}"/>
            </Grid>
        </ListView.Footer>
    </ListView>
</ContentPage>
0reactions
AndreiMisiukevichcommented, Jul 17, 2019

unfortunately it won’t be fixed since it’s XF bug

Read more comments on GitHub >

github_iconTop Results From Across the Web

MarkupExtension not found for d:DesignInstance · Issue ...
I have a fresh Xamarin.Forms app with FreshMvvm, using .Net Standard 1.4 for my main assembly. I'm seeing an exception on the following...
Read more >
HotReload: MarkupExtension not found for d:DesignInstance
HotReload: MarkupExtension not found for d:DesignInstance ... When attempting to reload a page with the following declarations, it fails with the StackTrace below ......
Read more >
Xamarin.Forms Previewer: MarkupExtension not found for ...
The Xamarin.Forms Previewer crashes on this Code Sample And displays nothing. Xamarin forms happily compiles this. I use this for intellisense.
Read more >
Xaml markup extension not found - xamarin.forms
In my Xamarin Forms app I am trying to set the source of an Embedded Image in one of my xaml files but...
Read more >
Consuming XAML Markup Extensions - Xamarin
This article explains how to use Xamarin.Forms XAML markup extensions to enhance the power and flexibility of XAML by allowing element ...
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