TagEntryView with XAML : FileNotFoundException

Hi,

I try to use the TagEntryView in a Xaml page. I use the Cross-platform Xamarin Forms with MVVM pattern and Xaml page.
I add :

  • the nuget package to all projects (PCL + each platform)
  • namespace to PageContent

When I run, I have this exception : System.IO.FileNotFoundException: Could not load file or assembly 'DLToolkit.Forms.Controls.TagEntryView' or one of its dependencies
How can I solve this issue please ? Thanks in advance

My XAML looks like this

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:behaviors="clr-namespace:Teedl.Mobile.Behaviors"
    x:Class="Teedl.Mobile.Views.ConnectionsView"
    xmlns:dltoolkit="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.TagEntryView"
    Title="Connection Request">
<ContentPage.Content>
<ScrollView VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<StackLayout Orientation="Vertical" Padding="2">
    <dltoolkit:TagEntryView TagTappedCommand="{Binding RemoveTagCommand}" TagItems="{Binding ConnectionType}" Spacing="2" />
...

Answers

  • GeraldVersluisGeraldVersluis NLUniversity ✭✭✭✭

    Try instantiating a dummy instance of the TagEntryView in code in your platform project.

    I.e. in your AppDelegate.cs do;

    var foo = new TagEntryView();
    

    See if that helps. I think there is a bug (or not a bug, don't really know..) which optimises the dll away if it is only used in Xaml (and thus not detected as a dependency by the compiler).

  • KarineROBINOTKarineROBINOT USMember
    edited April 2016

    I try your solution. I have another exception of type NullReferenceException but when I set a breakpoint, I can see that my list "ConnectionType" is not null :/

    I insert a comment in the stack trace where I set my breakpoint

    The stack trace :
    at DLToolkit.Forms.Controls.TagEntryView.ForceReload () [0x00026] in <filename unknown>:0 at DLToolkit.Forms.Controls.TagEntryView.TagEntryViewPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0003e] in <filename unknown>:0 at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <filename unknown>:0 at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x000fb] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x0020b] in <filename unknown>:0 at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in <filename unknown>:0 at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) [0x00042] in <filename unknown>:0 at Xamarin.Forms.BindableObject.ApplyBindings (System.Object oldContext, Boolean skipBindingContext) [0x0003b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.ApplyBindings (System.Object oldContext) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in <filename unknown>:0 at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in <filename unknown>:0 at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in <filename unknown>:0 at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00061] in <filename unknown>:0 at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in <filename unknown>:0 at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in <filename unknown>:0 at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00061] in <filename unknown>:0 at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in <filename unknown>:0 at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in <filename unknown>:0 at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00061] in <filename unknown>:0 at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in <filename unknown>:0 at Xamarin.Forms.TemplatedPage.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00008] in <filename unknown>:0 at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in <filename unknown>:0 at Xamarin.Forms.Page.OnBindingContextChanged () [0x00000] in <filename unknown>:0 at Xamarin.Forms.ContentPage.OnBindingContextChanged () [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0001b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x0010e] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x0005f] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in <filename unknown>:0 // I took the picture at this moment at Teedl.Mobile.Views.ConnectionsView..ctor (Teedl.Mobile.ViewModel.BusinessRequest.ConnectionBusinessRequestModel connection) [0x00016] in C:\Users\Karine.TEEDL\Documents\plateform\01-Presentation\Mobile\Teedl.Mobile\Teedl.Mobile\Views\BusinessRequest\ConnectionsView.xaml.cs:22 at Teedl.Mobile.ViewModel.BusinessRequest.BusinessRequestListViewModel+<OnItemSelected>d__37.MoveNext () [0x000f9] in C:\Users\Karine.TEEDL\Documents\plateform\01-Presentation\Mobile\Teedl.Mobile\Teedl.Mobile\ViewModel\BusinessRequest\BusinessRequestListViewModel.cs:73 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:994 at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/src/UIKit/UIKitSynchronizationContext.cs:24 at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/src/Foundation/NSAction.cs:163 at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/src/UIKit/UIApplication.cs:77 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/src/UIKit/UIApplication.cs:61 at Teedl.Mobile.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\Karine.TEEDL\Documents\plateform\01-Presentation\Mobile\Teedl.Mobile\Teedl.Mobile.iOS\Main.cs:17

  • KarineROBINOTKarineROBINOT USMember

    I found the problem. The TagEntryView works with ObservableCollection instead of List

Sign In or Register to comment.