Does protobuf-net support Windows RT? - windows-runtime

Is it possible to use the protobuf-net library in an application that targets Windows RT? I tried adding it via NuGet to my project but I receive this error:
Successfully installed 'protobuf-net 2.0.0.480'.
Successfully uninstalled 'protobuf-net 2.0.0.480'.
Install failed. Rolling back...
Could not install package 'protobuf-net 2.0.0.480'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.

You need a newer version. Version 594 has support for 4.5.
In the package manager console (Tools->Library Package Manager->Package Manager Console) run:
PM> Install-Package protobuf-net -Version 2.0.0.594
Or download it from the project web site.

Yes, the more recent builds have full support for .NETCore (aka "WinRT", "Windows Store Applications", or "Metro", or "Modern UI", or whatever they want to call it today). As Eli notes, you can obtain it by specific version, or you can get it from the google-code download.
Note that for the best performance it is recommended to use "precompile", the new precompiler, because .NETCore has no support for meta-programming: without this, it will be using reflection at runtime, and will not be anywhere near as fast as it can be. This is included in the google-code download.

Related

Sideloaded app requires package Microsoft.VCLibs.120.00 on my build server

In trying to run integration tests on my windows store app but the sideloading of my test appx file fails with error (0x80073CF3):
Windows cannot install package (my package GUID) because this package depends on another package that could not be found. This package requir
es minimum version 12.0.21005.1 of framework Microsoft.VCLibs.120.00 published by any publisher to install. Provide the framework along with this package..
The same procedure works fine on my dev machine (from powershell).
A Microsoft blog post states:
...In order to facilitate this scenario for sideloaded apps, we have made
the framework packages available here.
After downloading, and extracting the relevant architecture appx file, I installed it via powershell:
Add-AppxPackage "C:\temp\Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe.appx"

Autofac.Mef and WinRT

I'm having troubles while trying to add the Metadata of Autofac. I have to install the package "Autofac Extras: Metadata Attribute Support" which need Autofac.Mef. When installing this package, I get a message saying that I try to install Autofac.Mef 4.0.0 in a project targeting «portable-net45+win+wpa81» and that the package doesn't contain any file supporting this. (Same message with Autofac.Mef 3.0.3).
I could probably find a way to make my project work without Autofac's Metadata but I don't understand why this package isn't compatible with Windows Phone 8.1. Is there a solution to this issue?
Thanks in advance
Thomas
If you download the Autofac.Mef package manually and then open it up in NuGet Package Explorer you'll see that the Autofac.Mef package only targets .NET 4.5 apps - you can't use it in Windows Phone.
The reason for this is that the original framework MEF is only compatible with the full .NET framework. There's a "lighter weight" MEF 2 framework that is compatible with Windows Phone 8.1 but that's not the one Autofac.Mef works with.
There's no way to fix it. There's also no current plan to switch Autofac.Mef to using the Microsoft.Composition package.

VS 2015 + universal app + mvvmcross 3.5.0 + sqlite

I started a new universal app using vs 2015 ctp 5, mvvmcross 3.5.0 + sqllite plugin 3.5.0.
I am using the famous N=.... serie of vídeos, especificaly n=12 Collect A Bull as a reference.
I created a new pcl Project as a core and a universal app Project(3 projects), added nuget packages to core , wp8.1 and to w8.1, everything good so far.
Then i copied the service folder from N=12 sample, added related nuget packages.
My trouble is: at this line _connection = factory.Create("collect.sql"); on repository i've got a exception :
A first chance exception of type 'System.DllNotFoundException' occurred in Cirrious.MvvmCross.Plugins.Sqlite.WindowsCommon.DLL
Additional information: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
The message is pretty clear cannot found sqlite3.dll i've seen some articles to add file and reference manually, but i did not see nothing on the vídeo, and the N-12 sample runs ok?
How the sample can access the mentioned sqlite dll, it could be related to universal app?
By comparison i found a missing reference in wp project: Community.CsharpSqlite.WP7 i added manually but does not solve.
Any suggestions?
So, to solve this i just have to download from http://www.sqlite.org/download.html and add reference manually
Thanks to mohibsheth on jabbr room
Try adding
Install-Package MvvmCross.HotTuna.Plugin.Sqlite -Version 3.2.1
from package manager console. It worked for me.
If directly it didn't worked, then remove all the packages and add all packages of version 3.2.2 like :
Install-Package MvvmCross -Version 3.2.2
Install-Package MvvmCross.HotTuna.Plugin.FieldBinding -Version 3.2.2
Install-Package MvvmCross.HotTuna.Plugin.Messenger -Version 3.2.2
Still having problem with the packages?Uncheck Silverlight from Core project properties.
Version 3.5.0 raising problems for me too.
Hope this helps.
I would check out the SQLite.Net-PCL project. I've heard of some success in people using that although I have not personally used it yet.
I just submitted a pull request to the MvvmCross Community SQLite project to update it to MvvmCross 3.5 and unified iOS API - so you could give that a try as well. There is no new NuGet for that yet however. You'll need to clone the project and compile it yourself.

Cant use NuGet to add Unity IoC to a portable class library

I am making a Windows Phone 8 application, however because I would like at some point to also publish this application for Windows 8.1 store I made the effort to factor out the application logic into a portable class library. All good so far.
Now being a good boy I want to use an IoC container, unity by preference (since I am familiar with it in desktop and Win Phone 8 only apps)
So here's my problem; the NuGet Unity package will not install into my portable application with this result:
Installing 'Unity 3.0.1304.1'.
Successfully installed 'Unity 3.0.1304.1'.
Adding 'Unity 3.0.1304.1' to Logic.
Uninstalling 'Unity 3.0.1304.1'.
Successfully uninstalled 'Unity 3.0.1304.1'.
Install failed. Rolling back...
Could not install package 'Unity 3.0.1304.1'. You are trying to install this package into a
project that targets 'portable-net45+wp80+win', 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.
So is there a unity that works with a PCL? or is this just a shortcoming of the NuGet package?
I failed to find any useful documentation on the P&P website to indicate what platforms it is compatible with, but I know it does support WP8 at the least since the NuGet package is quite happy with libraries targeting just that.
Any guidance from the community would be very welcome here I don't want to abandon using a PCL for my app logic if I can avoid it, but if it comes down to a toss up between that and NuGet for package management I will in order to keep the NuGet goodness.
Could this be related to NuGet and Portable Class Libraries - Package doesn't target any framework? that seems more related to making your own NuGet packages for use in your own PCLs.
Unity 3.0.1304.1 does not contain any PCL assemblies so you will not be able to install it into a PCL project using NuGet.
The Unity NuGet package contains assemblies that target the following frameworks:
.NETFramework 4.5
.NETCore 4.5 (Windows Store/WinRT)
Windows Phone 8
You can see these target frameworks if you open the NuGet package into NuGet Package Explorer or download the NuGet package and open it using a program that supports zip files such as 7zip or Windows built-in zip file support.
So your possible options are:
Just use Unity in your main Windows Phone 8 application.
Write your own IOC container.
Use an IOC container that supports PCL projects such as Portable.CommonServiceLocator.
Compile your own PCL version of Unity.
Use a later version of Unity 3.5 since this includes a PCL assembly targeting portable-net45+wp80+win8+MonoAndroid10+MonoTouch10
Updated: 2014-05-11
Unity 3.5 now includes a PCL assembly that targets portable-net45+wp80+win8+MonoAndroid10+MonoTouch10 which will install into a project that targets portable-net45+wp80+win.
There is no Unity for PCL, but you can use Ninject for example.

Nuget, Castle Windsor Client Profile vs Full Profile

I'm trying to use Castle Windsor with Log4Net facility. I've installed the packages through Nuget.
The requirement for this to work is to use Full profile Castle.LoggingFacility. Nuget referenced the Client Profile version.
How can I force Nuget to install the Full profile version?
I might be wrong but it sounds like the issue with the target framework setting on your project:
for Castle.Windsor to work it has to be set to .NET Framework 4 rather than to .NET Framework 4 Client Profile.
You can configure it by opening project properties, tab Application (in Visual studio) or just editing the project file.
If that's about the version of the package after all, then usually using NuGet you can append a flag install-package Castle.Windsor -version 2.5.3 to specify which one to install, but I couldn't find any options there when it comes to Castle.LoggingFacility.
I had the same problem earlier and I think you should check your packages.config file. There could be targetFramework="net40-client",
which points NUGet to the packages\Castle.LoggingFacility.3.2.0\lib\net40-client directory.
Simply change it to net40 and all's done.