Bug 33135 - Apps built for Windows 8.1 using XF, fail on Windows 10 release, with System.NotImplementedException
Summary: Apps built for Windows 8.1 using XF, fail on Windows 10 release, with System....
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 1.4.3
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
URL:
: 40683 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-08-15 09:09 UTC by John Hardman
Modified: 2017-04-15 22:09 UTC (History)
21 users (show)

Tags: x64 Windows exception ac
Is this bug a regression?: ---
Last known good build:


Attachments
Sample Project (709.38 KB, application/zip)
2016-01-04 16:35 UTC, John Miller [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description John Hardman 2015-08-15 09:09:55 UTC
As per forum posts at https://forums.xamarin.com/discussion/comment/146671#Comment_146671 apps built for Windows 8.1 using XF, fail on the release version of Windows 10 with System.NotImplementedException.

As well as myself, another user has confirmed also hitting this problem (see the forum for details).


My app runs happily on Windows 8.1 and on a preview build of Windows 10, but on the release build of Windows 10, the XF Application constructor throws the following exception.

System.NotImplementedException was unhandled by user code
 HResult=-2147467263
 Message=The method or operation is not implemented.
 Source=Windows.UI.Xaml
 StackTrace:
 at Windows.UI.Xaml.Setter.get_Value()
 at Xamarin.Forms.Platform.WinRT.WindowsResourcesProvider.GetStyle(Object nativeKey)
 at Xamarin.Forms.Platform.WinRT.WindowsResourcesProvider.GetSystemResources()
 at Xamarin.Forms.Application..ctor()
 at MyApp.App..ctor()
 at MyApp.StoreAppWindows.MainPage..ctor()
 at MyApp.StoreAppWindows.MyApp_StoreAppWindows_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage()
 at MyApp.StoreAppWindows.MyApp_StoreAppWindows_XamlTypeInfo.XamlUserType.ActivateInstance()
 InnerException:
Comment 1 Parmendra Kumar 2015-08-17 13:09:07 UTC
@John

I have checked this issue on Windows 10 with X.F version 1.4.4.6392 & 1.5.0.6396-pre1 and not able to reproduce this issue.

Could you please provide us sample project? so that I can reproduce this issue.


Thanks..!
Comment 2 John Hardman 2015-08-18 09:19:52 UTC
My Packages.Config for this project is as follows:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Band" version="1.3.10702" targetFramework="win81" />
  <package id="MR.Gestures" version="1.2.1" targetFramework="win81" />
  <package id="Xamarin.Forms" version="1.4.4.6392" targetFramework="win81" />
  <package id="Xamarin.Insights" version="1.10.6" targetFramework="win81" />
  <package id="Xamarin.Microsoft.Band" version="1.3.4.1" targetFramework="win81" />
</packages>


The stack trace when the exception occurs is:

System.NotImplementedException was unhandled by user code
  HResult=-2147467263
  Message=The method or operation is not implemented.
  Source=Windows.UI.Xaml
  StackTrace:
       at Windows.UI.Xaml.Setter.get_Value()
       at Xamarin.Forms.Platform.WinRT.WindowsResourcesProvider.GetStyle(Object nativeKey)
       at Xamarin.Forms.Platform.WinRT.WindowsResourcesProvider.GetSystemResources()
       at Xamarin.Forms.Application..ctor()
       at MyApp.App..ctor()
       at MyApp.StoreAppWindows.MainPage..ctor()
       at MyApp.StoreAppWindows.MyApp_StoreAppWindows_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage()
       at MyApp.StoreAppWindows.MyApp_StoreAppWindows_XamlTypeInfo.XamlUserType.ActivateInstance()
  InnerException: 


So, the questions are:

(1) what does Xamarin.Forms.Platform.WinRT.WindowsResourcesProvider.GetSystemResources() do when called from the Xamarin.Forms.Application default constructor?
(2) what are the keys that GetSystemResources() passes to Xamarin.Forms.Platform.WinRT.WindowsResourcesProvider.GetStyle ?
(3) what is done differently between Windows 8.1 and Windows 10, and what is done differently between Windows 10 previews (on which this worked) and Windows 10 release?


The App.xaml file is as follows (From the stack trace, I assume this is relevant). With the source code and this information, it should be possible to work out what is happening. If you want to give me read-only access to the source under a Non-Disclosure Agreement, I'll take a look.

<Application
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="MyApp.App">

    <Application.Resources>
        <ResourceDictionary>

            <Style BaseResourceKey="BodyStyle" TargetType="Label" x:Key="MyAppBodyStyle"> 
                
            </Style>

            <Style BaseResourceKey="CaptionStyle" TargetType="Label" x:Key="MyAppCaptionStyle">

            </Style>

            <Style BaseResourceKey="ListItemDetailTextStyle" TargetType="Label" x:Key="MyAppListItemDetailTextStyle">

            </Style>

            <Style BaseResourceKey="ListItemTextStyle" TargetType="Label" x:Key="MyAppListItemTextStyle">

            </Style>

            <Style BaseResourceKey="SubtitleStyle" TargetType="Label" x:Key="MyAppSubtitleStyle">
                <Setter Property="BackgroundColor" Value="#00FF00"></Setter>
                <Setter Property="TextColor" Value="#FF0000"></Setter>
            </Style>

            <Style BaseResourceKey="TitleStyle" TargetType="Label" x:Key="MyAppTitleStyle">
                <Setter Property="BackgroundColor" Value="#0000FF"></Setter>
                <Setter Property="TextColor" Value="#FF0000"></Setter>
            </Style>

            <!-- Using a style that picks up changes to a built-in style directly -->
            <!--<Label Text="Welcome" Style="{x:DynamicResource MyAppTitleStyle}" /> -->


        </ResourceDictionary>
    </Application.Resources>
    
</Application>
Comment 3 John Hardman 2015-08-18 09:20:54 UTC
Changed back to New as per a previous instruction (and because things left as NEEDINFO don't seem to be picked up again, even when changes have been made to the bug)
Comment 4 Paul DiPietro [MSFT] 2015-08-18 13:07:14 UTC
At this moment I am not able to reproduce the issue on Windows 10 with Forms 1.4.3 or 1.4.4. I am setting this to NEEDINFO and as mentioned in comment 1, providing exact reproduction steps (and potentially a project) would help in investigating this issue.
Comment 5 Raj 2015-10-13 05:45:56 UTC
Hi any one got solution for this issue as mentioned in Comment 1.
It will be great to know cause of this.
Comment 6 John Hardman 2015-10-13 08:28:38 UTC
Hi Raj.

I haven't heard anything more.

This is clearly an issue that is highlighted by environmental factors, so the repeated request for "exact reproduction steps" is unhelpful. The exact reproduction steps are to build ANY Xamarin Forms app and run it on a Windows 10 PC. On some machines it will work, on some it will fail.

Without better diagnostics in the Xamarin Forms assemblies, or without some useful feedback from Xamarin about what the failing method is actually doing (the source code for that method would help for a start), we are reliant on somebody at Xamarin actually investigating rather than bouncing another "exact reproduction steps" message.

If you have any helpful contacts at the support desk, please do try them, as otherwise this problem might still be there in another 6 months. I have had the support desk reject requests for help on things (that are important) like this, yet also had them plough ahead on fixing things that are irritating but not important. Prioritisation still needs work...

Regards,

John H.
Comment 7 John Hardman 2015-10-13 09:10:39 UTC
Just to prove the point - I've just re-built the Forms Gallery example and tried running it on Windows 10. Same exception.
Comment 8 Raj 2015-10-15 01:54:32 UTC
Hi John,

You got any solution to resolve this issue by rewriting solution,etc.
Is your application still giving you same exception.

One more point missed while reporting issue that in my case first time when we run application it worked fine but when I launched second time it start giving issue as mentioned in Comment 1.
Also while doing trials application at one time it worked but again it gives same behavior.

Also same applications old package working fine on Windows 10.

We checked my code change but not able to figure out cause of this issue.


Regards,
Raj
Comment 9 Raj 2015-10-15 03:36:03 UTC
Hi John,

You got any solution to resolve this issue by rewriting solution,etc.
Is your application still giving you same exception.

One more point missed while reporting issue that in my case first time when we run application it worked fine but when I launched second time it start giving issue as mentioned in Comment 1.
Also while doing trials application at one time it worked but again it gives same behavior.

Also same applications old package working fine on Windows 10.

We checked my code change but not able to figure out cause of this issue.


Regards,
Raj
Comment 10 Raj 2015-10-15 03:41:56 UTC
Hi John and all,

I just able to resolves issue from my PC I think it will sure work for you guys also.

To get solution I have to go debugging into deep designer and debugger generated files also taking reference of Win32 programming basic knowledge.


So the solution is build your package with x86 platform.

It worked!!!

It might solved your problem too, please try it.



Regards,
Rajendra Bhandri
Comment 11 John Hardman 2015-10-15 06:19:47 UTC
This may help Xamarin narrow down the problem, but it's only a workaround, not a solution.

If I am deploying an application to 64 bit Windows 10 running on an x64 machine, I want to be able to run my app as 64 bit. Using x86 doesn't do that. Using Any CPU may or may not do that. It should be possible to deploy using an x64 build.

But yes, I can run Forms Gallery built with x86 or Any CPU, but not x64, which exhibits the exception described above.

Xamarin - please investigate.
Comment 12 Raj 2015-10-15 07:13:47 UTC
Hi John,

Yes you are right.
 But to get solution either xamarin need to provide implementation of all API method specific to platform targeted or we have to found which Xamarin API we used that didn't have x64 based implementation  not done by Xamarin replace with them alternative But again for that Xamarin should provide details in exception thrown so we can resolve.

Right now above both options not present for this kind of issues, might be other alternative present which we don't know Xamarin can helps in that. 

Provided workaround definitely not solution but to make app run properly without black screen is achieved.   

Regards,
Rajendra
Comment 13 John Hardman 2015-10-15 10:48:59 UTC
And just a reminder for Xamarin - this does work on Windows 8.1, but fails on Windows 10.
Comment 14 dsturgeon 2015-12-07 12:23:51 UTC
I have been able to reproduce this issue repeatedly.  The key has been to build the application for X64 and run on windows 10.  It works as expected on  windows 8.1 for all build configurations.   The problem is only on windows 10 in x64.

I have posted much more detail and a sample project on the forums here :https://forums.xamarin.com/discussion/comment/169422#Comment_169422

I would be happy to help with additional clarifications regarding my system if needed.
Comment 15 John Miller [MSFT] 2016-01-04 16:35:12 UTC
Created attachment 14432 [details]
Sample Project

Attaching a sample from: https://forums.xamarin.com/discussion/comment/168706/#Comment_168706

Steps to reproduce:

- Open the attached sample in VS. 
- Rebuild the solution for x64 configuration
- Deploy to Windows 10 for x64

An System.NotImplemented exception will occur on launch.
Comment 16 John Hardman 2016-01-05 09:51:56 UTC
Changing to CONF as John Miller reproduced (see above).
Comment 17 Davide Zordan 2016-02-14 19:10:03 UTC
Hi,
I have created a new solution based on the cross-platform (portable) template and updated it to XF version 2.0.1.6505.

When I select the UWP project and change the platform target to x64, the solution builds correctly but I get the following exception when application is launched:
System.NotImplementedException was unhandled by user code
HResult=-2147467263
Message=The method or operation is not implemented.
Source=Windows
StackTrace:
at Windows.UI.Xaml.Setter.get_Value()
at Xamarin.Forms.Platform.UWP.WindowsResourcesProvider.GetStyle(Object nativeKey)
at Xamarin.Forms.Platform.UWP.WindowsResourcesProvider.GetSystemResources()
at Xamarin.Forms.Application..ctor()
at App9.App..ctor()
at App9.UWP.MainPage..ctor()
at App9.UWP.App9_UWP_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage()
at App9.UWP.App9_UWP_XamlTypeInfo.XamlUserType.ActivateInstance()
InnerException:

All works properly if I select the x86 target.

Thanks,
Davide
Comment 18 John Hardman 2016-03-21 12:35:46 UTC
Still a problem in 2.1.0.6529
Comment 20 Chris King 2016-04-14 02:40:14 UTC
Reproduced by executing attached project with x64|Debug config on Windows 10. XF calls into WinRT through 'managed header file' at C:\WINDOWS\system32\WinMetadata\Windows.UI.Xaml.winmd which then binds via registry to actual implementation possibly at c:\Windows\SysWOW64\Windows.UI.Xaml.dll which is not IL so cannot be disassembled. So WinRT implementation of Windows.UI.Xaml.Setter.get_Value is not implemented. Odd. 

The actual line throwing is hooking up the 'FontWeightProperty'. Wrapping that logic in a try/catch prevents the crash. 

Will have to follow up with Windows.UI.Xaml team.
Comment 21 Samantha Houts [MSFT] 2016-04-23 21:17:03 UTC
Should be fixed in 2.3.0-pre1. Thank you!
Comment 22 Samantha Houts [MSFT] 2016-04-25 22:22:19 UTC
*** Bug 40683 has been marked as a duplicate of this bug. ***
Comment 23 aaron sulwer 2016-05-17 23:03:50 UTC
this issue appears in version 4.0.4.4 in VS2015
Comment 24 aaron sulwer 2016-05-18 14:35:50 UTC
this is correct - Should be fixed in 2.3.0-pre1