TargetInvocationException when using uwp bluetooth APIs in .NET 5 winforms app - c#

The code works fine on Windows 10,
but I'm getting TargetInvocationException in Windows 8.1 when using uwp bluetooth APIs in my .NET 5 winforms app
inner exception is
Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))
code:
private BluetoothLEAdvertisementWatcher BTWatch = new BluetoothLEAdvertisementWatcher();
in my project I have added reference to "UwpDesktop-Updated" package & windows SDK 10.0.17763.132 is installed on my Windows 8.1 machine.
Let me know how to fix this issue occurring on windows 8.1

TargetInvocationException when using uwp bluetooth APIs in .NET 5 winforms app
I'm afraid you can't run it in Windows 8.1 system, please refer BluetoothLEAdvertisementWatcher document, the support lowest version is Build 10240, and it will not work in Windows 8.1 system.

Related

TeeChart for Xamarin.Forms with Windows 8 (WinRT) apps

We have a Xamarin.Forms app that also supports Windows 8/8.1 as a platform. Xamarin.Forms has support for WinRT and that's how it can be deployed to Windows 8/8.1.
We are using TeeCharts for Xamarin.Forms however, it doesn't seem to support WinRT as a platform. Is there a way to use TeeCharts for Xamarin.Forms with Windows 8/8.1?
I'm afraid TeeChart for Xamarin.Forms doesn't support WinRT (Windows 8/8.1).
However, TeeChart.Store.dll should be able to target this environment without problems. Please, contact "info at steema dot com" - referencing this post - for further instructions about how to get it.

Camera capture task is not working after migrating to Windows Phone Silverlight 8.1 from 8

I migrated my app from 8 to 8.1. The CameraCaptureTask which was working fine before is crashing the app with the exception shown in the screenshot.
Note: I am using Xamarin Shared project.

Visual Studio 2013 windows phone project templates doubts

I have updated my code to WP 8.1 and wanted to organise it better by using Class Libraries.
The doubt comes when I find there are 2 Class library project templates for Windows Phone:
Class Library (Windows Phone)
Class Library (Windows Phone
Silverlight)
If i select template 1, i see the assemblies referenced by default are .NET for Windows Store Apps and Windows Phone 8.1
If i select template 2, i got asked the target version of the Windows Phone OS (8.0 or 8.1) and the assemblies references by default are .NET for Windows Phone and Windows Phone.
Do you know the differences between them?
I have looked into the matter and seems it depends if you want to load the .NET runtime namespaces or not, am i correct? Are there any more differences?
The class library type will depend on whether your main app will be a Windows Phone 8.1 Silverlight app, or Windows Phone 8.1 XAML app.
The advantage of WP8.1 XAML app is that it is converged with Windows 8.1 - you can even create an Universal App that shares almost all code and xaml between the Win8 and WP8.1 apps.
The advantage of WP8.1 Silverlight app is that it is more closer to the old WP8.0 app - less changes are required, and also it has access to some APIs not available to WP8.1 XAML apps.

Use FileOpenPicker for windows phone 8

I believe, FileOpenPicker was added in Windows Phone SDK 8.1 which supports browsing through the music library, video library etc to let the user select a file. This functionality(API) was not available on windows phone 8 sdk. Problem is that windows phone sdk 8.1 can only be installed over visual studio 2013. I have installed VS2013 and SDK 8.1, When I build an app and try to deploy it on my windows phone running at 8.0 and not 8.1, it throws me an error saying it cannot be installed on this version of windows phone OS.
I wonder, whatsapp did not had any option to browse videos up till sdk 8.0 was released. with the release of sdk 8.1, it lets user to browse videos from the video library. I hope they are also making use of the API mentioned above. But this updated version of whatsapp which supports video library browsing, works on my Windows Phone with OS 8.0?
How were they able to use the API from 8.1 SDK and target the app for windows phone 8.0?
Is there any way I can created an app using SDK 8.1 and target the app to run on windows phone 8.0?
WhatsApp is one of the most popular apps on the Windows Phone platform. As a result, they are occasionally granted access to APIs and capabilities that are not yet available in the public SDK.

nuget failed to add references into Windows phone 8.1 project in universal apps

I have a strange problem, I am migrating a Windows Phone 8 app to Windows Phone 8.1 universal app. In that I am using Facebook and Facebook.Client packages. In Windows Phone 8.1 universal app project nuget package manager failed to add Facebook packages into the project by saying the error like Couldn't find any packages that support Windows phone 8.1, after this error I added the Facebook and Facebook.Client references manually from my old Windows Phone 8 project, when I build the project compiler throwing error:
Error 1 Cannot find type System.Windows.Controls.Control in module System.Windows.dll
Actually I added Windows Phone 8 Facebook.Client.dll. So compiler throws this error. After this I have added Windows 8 Facebook.Client.dll, the build succeeded. But when I call facebook Loginasync() method, I am getting NotImplementedException.
Any one help me how to resolve this exception. I guess Facebook packages are not updated to support Windows Phone 8.1 universal app. If so can any one help me how to integrate the Facebook in Windows Phone 8.1 universal app (Windows 8.1 its working fine).
The Facebook package has been migrated to the Universal app stack, however the Facebook.Client package has not. The Facebook.Client version for Windows Phone 8 targets the Silverlight version of the APIs, so it won't auto-magically convert to supporting Windows Phone 8.1 Universal projects. Someone is going to need to port it.
The source can be found here:
https://github.com/facebook-csharp-sdk/facebook-winclient-sdk
For Windows Phone 8.1 there is a new step in the login process you need to do.
In OnActivated of app.xaml.cs add the following code:
if (args.Kind == ActivationKind.WebAuthenticationBrokerContinuation)
{
App.MobileService.LoginComplete(args as WebAuthenticationBrokerContinuationEventArgs);
}

Categories