-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ResourceProvider Exception in Xamarin.Forms 3.0 due to Signature Change #2835
Comments
The solution here I also converted your project to netstandard since it was .net 4.5 just to see and same issue |
Any chance for quick fix? It's blocking me from updating my app to any Xamarin.Forms greater than 2.5.1.527436... |
I'm literally investigating this right now, but still can't tell if we'll be able to deliver a fix, nor can't I give you a time frame. The workaround is to make sure all your dependencies are compiled against latest XF 3.0.0 |
I can confirm #2880 fixes the problem in my tests (attached repro and commercial 3rd party libraries). Repro Screenshot (using new Xamarin.Forms package containing fix): |
@LanceMcCarthy could you also confirm it works on iOS ? thanks |
@StephaneDelcroix confirmed working on iOS 11.4, iPhone 8 |
Hi @StephaneDelcroix , do you know when the next release will be with this fix? Thank you. |
@avintoptaros It looks like the fix is already included in the release-3.0.0-sr3 and beta-3.1.0-pre3. |
@stephanosio I see that on the release page there is no release-3.0.0-sr3 version (https://developer.xamarin.com/releases/xamarin-forms/xamarin-forms-3.0/) |
Description
Due to the change made in #1976 for Xamarin.Forms 3.0, ResourceDictionaries that were compiled with XF 2.4 fail to load throwing the following exception:
Can't resolve the reference 'System.Func`2<System.String,System.String> Xamarin.Forms.Internals.ResourceLoader::get_ResourceProvider()', referenced from the method 'System.Void TheExternalResourceDictionary::InitializeComponent()' in 'Xamarin.Forms.Core
In particular, the ResourceDictionary in this case contains the styles for custom Xamarin.Forms controls that have a minimum support Xamarin.Forms version of 2.4
Steps to Reproduce
Download the simple repro using the link at the bottom of this post. Let me walk you through the two solutions:
1- CustomControls.sln (aka CoolGrid)
This is very simple class library that contains one class,
CoolGrid
, that inherits fromXamarin.Forms.Grid
.The ResourceDictionary, "CoolGridTheme.xaml", is also very simple and contains a couple
OnPlatform
for height and a Style to set CoolGrid'sBackgroundColor
The compiled result was copied to the Libs folder in the 2nd solution's folder.
2 - ResLoaderRepro.sln
This solution contains the Xamarin.Forms 3.0 projects (created using the File > New > Xamarin.Forms app > Blank App template and only kept Android to keep it small).
I updated the XF NuGet page to the latest public release and added the reference to the CustomControls assembly in the Libs folder.
Finally, on MainPage, I add a single instance of CoolGrid:
Here's a screenshot to better explain the simplicity of the setup:
Expected Behavior
The
CoolGrid
control will render.Actual Behavior
An exception is thrown (see scrrenshot 4 below
System.MissingMethodException: System.Func`2<string, string> Xamarin.Forms.Internals.ResourceLoader.get_ResourceProvider()
Here's a screenshot of the break:
Basic Information
Screenshots
Screenshots inline with the explanation above.
Reproduction Link
Download the reproducible from here (3.1 MB)
The text was updated successfully, but these errors were encountered: