Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundException - Could not load file or assembly 'DLToolkit.Forms.Controls.FlowListView' #3

Closed
jfversluis opened this issue Jan 5, 2016 · 16 comments

Comments

@jfversluis
Copy link

Hi!

I've just added the FlowListView to my project but I can't get it to work.
I get a FileNotFoundException on DLToolkit.Forms.Controls.FlowListView as you can see below. Any ideas?

I'm using Xamarin.Forms 2.0.0.6487 in XAML.
I've cleaned & rebuilt my solution multiple times but to no avail.

2016-01-05 19:22:05.542 KembitBPAiOS[19902:4922186]
Unhandled Exception:
FreshTinyIoC.TinyIoCResolutionException: Unable to resolve type: Kembit.BPA.Pages.ChoosePizzaPage ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'DLToolkit.Forms.Controls.FlowListView' or one of its dependencies
File name: 'DLToolkit.Forms.Controls.FlowListView'
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00081] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/AppDomain.cs:746
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/AppDomain.cs:714

@jfversluis jfversluis changed the title FileNotFoundException FileNotFoundException - Could not load file or assembly 'DLToolkit.Forms.Controls.FlowListView' Jan 5, 2016
@daniel-luberda
Copy link
Owner

Can you give me your xaml code? (namespaces definitions) I think it's the reason it isn't working.

@daniel-luberda
Copy link
Owner

This is important one:

xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView" 

<flv:FlowListView></flv:FlowListView>

@jfversluis
Copy link
Author

Sure can!

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:static="clr-namespace:Kembit.BPA.Helpers;assembly=Kembit.BPA"
             xmlns:controls="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView"
             x:Class="Kembit.BPA.Pages.ChoosePizzaPage" Title="Kies je pizza..." BackgroundColor="{x:Static static:Constants.BackgroundColor}" IsBusy="{Binding IsLoading}">

<controls:FlowListView ItemsSource="{Binding PizzaList}" SelectedItem="{Binding SelectedPizza}" IsPullToRefreshEnabled="True"
                           RefreshCommand="{Binding LoadPizzasCommand}" IsRefreshing="{Binding IsLoading}" HasUnevenRows="True" SeparatorVisibility="None">
<!--ItemTemple etc.-->
</controls:FlowListView>

Got around it by copying the dll manually to the output folder on my Mac. Starting to think it is on my end, although Copy to Local is set to true.

@daniel-luberda
Copy link
Owner

That should work! Could you try flv instead controls?

BTW: Please mind there were some API changes in current repo that are not on nuget yet. I'll release it today.

@jfversluis
Copy link
Author

Doesn't help.. Weirdly it just seems to work when I manually include the DLL. But it will cause a problem when I will build a release package.

Another question; what is the easiest way to divide the ListView into two columns? I don't need anything fancy. Just want to show two columns of equal size :)

edit - Ah I see in the Xamarin Forums that you're adding new features for this? And they are in the NuGet you're releasing? I'll wait for that then!

@daniel-luberda
Copy link
Owner

If the problem exists only in release build, then it's definitely a linking issue. You should add those namespaces to linker exclude options. I will investigate that.

Another question; what is the easiest way to divide the ListView into two columns? I don't need anything fancy. Just want to show two columns of equal size :)

Just add 2 same columns definitions. Are you using the nuget dll? or current dll? The api changed (old methods are obsolete.

With new api something like that:

<flv:FlowListView x:Name="FlowListView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
    FlowItemsSource="{Binding Items}" SeparatorVisibility="None" HasUnevenRows="true" >

    <flv:FlowListView.FlowColumnsTemplates>
        <flv:FlowColumnSimpleTemplateSelector ViewType="{x:Type local:Views.YourCustomView}"/>
        <flv:FlowColumnSimpleTemplateSelector ViewType="{x:Type local:Views.YourCustomView}"/>
    </flv:FlowListView.FlowColumnsTemplates>

</flv:FlowListView>

...and that's all. I'll update samples soon with better ones.

@jfversluis
Copy link
Author

I'm using the NuGet!

So I'll wait for the new version of that!

Meanwhile I've found a sort-of cause to my problem. It seems that when there are no code references to the FlowListView the DLL is rendered non-used while building and thus not included.
When I add a bogus declaration in the code-behind like var foo = new FlowListView(); the problem is resolved.

@daniel-luberda
Copy link
Owner

Yes. I'll create static method to avoid linking issues when using only XAML. Something like FlowListView.Init(); If you want to test it before release, here is dll
https://mega.nz/#!RVAUlZzY!vbnr7LMqAxMKS18fnemIVBBMmblsel5ww8A5BaFHFIg

Yes, it's just a single DLL.

@jfversluis
Copy link
Author

Awesome! I will check it out! Thanks! :)

@daniel-luberda
Copy link
Owner

@pcdus
Copy link

pcdus commented Mar 17, 2016

Hi Daniel, I meet the same error whereas I have copied code that works in a project to another one...

@daniel-luberda
Copy link
Owner

Do you use it in XAML only?

  • Make sure you call FlowListView.Init() somewhere
  • Make sure you add nugets to all projects (shared and platform specific)

@pcdus
Copy link

pcdus commented Mar 18, 2016

Yes, I use it in XAML only.
As I wrote you through the Xamarin forum, I meet this problem only under the iOS project.
I just added the nugets to the iOS project but it didn't change anything...

I don't understand cause I use the FlowListView without any problem in another solution. In this solution, I only added the nugets in the PCL and all works fine.

In add, I don't see where I must place the call "FlowListView.Init()"? I don't use it in the other solution, and I don't find it either in your sample "DLToolkit.Forms.Controls"...

@daniel-luberda
Copy link
Owner

Put it in AppDelegate in iOS project, after Xamarin.Forms initialization.

@pcdus
Copy link

pcdus commented Mar 21, 2016

Thanks it's working like this.
Is there any reason that I must use this for a project and not for another one?

@ask-himanshu
Copy link

DLToolkit.Forms.Controls.FlowListView.dll.so' not found issue is coming what should i do to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants