LiveSDK 5.6.3 not working in UWP store app - c#

I have a universal windows store app targeting Windows 10. In a previous version of the app targeting Windows 8.1 I used the LiveSDK (the 5.6 version here) to access data from the user's MS Live account using the LiveAuthClient. In the new version of the app, I figured I'd use the most recent version of the LiveSDK (5.6.3 available as a nuget package here) but when I install the nuget package, I am unable to to access the Microsoft.Live namespace.
For example, the following statement:
using Microsoft.Live;
Produces the error "The type or namespace 'Live' does not exist in the namespace 'Microsoft'"
Is this package broken or am I missing something obvious here? I would have expected this to work just like it did with the 5.6 version of the LiveSDK. It also seems like the documentation for the LiveSDK is all pointing to info about the OneDrive api now so it makes me wonder if the purpose of the sdk has changed. I'm confused... What's the most recent version of the LiveSDK (the one that has the LiveAuthClient) and where can I find it?

I'm not sure why Nuget Manager doesn't add a reference automatically, but it seems to work once you add a reference manually from directory:
C:\Users\USER\.nuget\packages\LiveSDK\5.6.3\WindowsXAML\MicrosoftLive.dll.

Related

Missing System.Media.Capture.Frames namespace

I'm trying to develop a barcode reader app for the Microsoft HoloLens (using this tutorial) but I'm encountering a problem. In the code of this tutorial, there's being referenced to the System.Media.Capture.Frames namespace and it seems like I'm missing this namespace. Looking at the Windows universal samples from Microsoft, there's also being referenced to this namespace. However, I cannot import this namespace.
I'm running on Windows 10 Version 1607 Build 14393.693
I have .NET Framework 4.6.2
My Windows is fully up-to-date
Does anyone have any idea how I can get access to this namespace?
Two likely problems:
You need Windows.Media.Capture.Frames not System.Media.Capture.Frames
Windows.Media.Capture.Frames is new for build 14393 so you'll need to make sure your app targets at least that high:
Go to your app's project properties and make sure your target version is set to Build 14393 on the Application tab. Alternatively open the csproj in a text or XML editor and set the TargetPlatformVersion there:
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
If your minimum version is less than 14393 then make sure you do feature detection with the ApiInformation class before calling the Frames functions to make sure they exist.

How to add the MySQL Connector to a UWP C# app?

I am using Visual Studio 2015 the community version.
When I try to add the MySQL Connector in the references it will fail even when I try to add it via NuGet Packages it still fails.
I have tried searching the web for solutions but I kept getting the same result, failure.
I have no idea where to get a .NETCore version of MySQL Connector.
Here is my error
As your exception image suggested, the error is clearly:
The project targets '.NETCore' while the file reference targets '.NetFramework'. This is not a supported scenario.
To see the difference between them, you can refer to the answer here: How does Windows 8 Runtime (WinRT / Windows Store apps / Windows 10 Universal App) compare to Silverlight and WPF? [closed].
For the MySQL Connector for WinRT, you can refer to Chapter 7 Connector/Net Support for Windows Store.
Just tested, you can download mysql-connector-net-6.7.9.msi here, if your device has installed higher version of connector like 6.9.9, you probably need to remove it and install this 6.7.9 version. (Don't know why, as my test result, it seems 6.9.9 doesn't have MySql.Data.RT.dll, didn't look into it, it is possible that I didn't install it correctly, anyway 6.7.9 works for me.)
Then you can find the MySql.Data.RT.dll in your MySQL connector installed path for example: C:\Program Files (x86)\MySQL\MySQL Connector Net 6.7.9\Assemblies\RT, and for UWP app, you can reference this .dll file successfully:
You should follow this guide and install proper .NET Core Connector.
http://insidemysql.com/mysql-connector-net-for-net-core-1-0/
To achieve this, you should use Package Manager Console and follow the guide above.
Let me know if it works for you.

Desktop C# - Referencing Windows.Devices

I am trying to create a classic desktop application for Windows 10 in C# that will be able to talk to BLE devices.
I followed the instructions (Bluetooth 4.0 (low energy) API for windows desktop C# application) and added the tag to the project file
<TargetPlatformVersion>10.0.10156</TargetPlatformVersion>
and reloaded the project. I am given access to the Windows namespace only: references dialog
I don't know what I did in one of my testings, but once that list got populated with a whole lot of other namespaces, giving me the ability to check Windows.Devices namespace, which is essential for my project.
I can now add the Windows.Devices via Recent option, but can not add any other namespace...
Do you guys have any idea what should I do to access the list of all Windows.x.y namespaces?
To access Windows.Devices and other WinRT API's from .NET Framework code,
Add the NuGet package Microsoft.Windows.SDK.Contracts to the project
Configure the project to support Package References (right-click packages.config, select Migrate packages.config to PackageReference...)
From the OP's author comment:
Update - I created a new project and adding C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd and C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll allowed me to include Windows.Devices namespace without selecting Windows.Device in the References dialog.
This worked for various of us.
There is now a Windows.SDK.Contracts NuGet package which helps with this issue. I wasn't able to add the above DLLs, but the nuget package worked.
The Windows 10 WinRT API Pack enables you to add the latest Windows
Runtime APIs support to your .NET Framework 4.5+ and .NET Core 3.0+
libraries and apps.
This package includes all the supported Windows Runtime APIs up to Windows 10 version 1903.

Xamarin.Forms could not install package

When creating a new solution within Xamarian studio I get this error
Could not install package 'Xamarin.Forms 1.0.6186'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Is there a certain version of .Net that Xamarian Forms requires for it to be included in the solution? I've tried searching in their documentation but I'm only seeing marketing and not real in depth documentation.
I had a similar issue using Visual Studio and I've found that the following combination in the PCL works:
.NET Framework 4.5
Windows Phone Silverlight 8
Xamarin.Android
Xamarin.iOS
You have created the wrong project type, you created a normal Windows app, and I assume you are targeting iOS/Android or Mac.
Create the project with the correct type and it should work correctly.
If you are using Xamarin Studio for Windows (without also having Visual Studio installed) you need to download the Portable Library Tools. See the Xamarin doc Introduction to Portable Class Libraries.
I had the same problem with my Xamarin project. The problem was, that in the portable Xamarin project Windows Phone Silverlight was set as target. The PCL project from which I created the nuget, didn't reference Silverlight as target. I don't need Silverlight, so uninstalling all nuget packages from my portable Xamarin project, removing silverlight as target and reinstalling the NuGet packages solved it.
I had similar issue using VS and I found solution here - http://forums.xamarin.com/discussion/29674/xamarin-forms-dll-cannot-be-installed
"It looks like your NuGet Package Manager needs to be upgraded. The Xamarin PCL Profiles are installed but NuGet is not recognising Xamarin.iOS as a target framework. You can update NuGet by selecting Tools - Extensions and Updates, then select the Updates tab, then select Visual Studio Gallery. Then update NuGet from there."
I have invested a lot of time trying all the solutions posted here, but none of them helped me... Here is the solution that worked for me (on Windows 10):
1.) Open your .csproj file
2.) Find the TargetFrameworkProfile entry
3.) This entry contains Profile78 for me, therefore I open the folder below
c:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETPortable/v4.5/Profile/Profile78/SupportedFrameworks
4.a) If the folder does not exist, then use one of the solutions posted here to install the PLC right on your PC
4.b) Unfortunately, ASP.NET and Xamarin don't like each other, therefore delete all ASP profiles from this folder. For me it was ASP.NET Core 5.0.xml. Obviously this will break your ASP.NET support in VS
5.) Restart Xamarin and have fun!
interesting reading about all that:
https://forums.xamarin.com/discussion/52846/cannot-create-new-xamarin-forms-project-pcl-in-xamarin-studio-win10-vs2015

FourSquare Client library for WP8

Is there any foursquare client library available for Windows Phone 8. i checked the foursquare site and this client 'Sharp Square' but whenever i try to include it in my project i got the version incompatible error
install-package : Could not install package 'SharpSquare 1.0.0.2'. You are trying to
install this package into a project that targets 'WindowsPhone,Version=v8.0',
but the package does not contain any assembly references or content files that are
compatible with that framework.
i also tried adding the .dll after building the project but got the same error..
Loking at the source code of SharpSquare on GitHub (https://github.com/TICLAB/SharpSquare) there is no version that works with Windows Phone 8.
You need to convert it to a Windows Phone library. It should not be difficult, just removing the unnecessary references to System.Web and making all the request asynchronous. Here is my take on it, it compiles but I have not tested it: https://dl.dropboxusercontent.com/u/73642/SharpSquareWP8.zip
I think the best thing you can do is leverage Foursquare REST API https://developer.foursquare.com/docs/
And a library like RestSharp to work with them.

Categories

Resources