Does protobuf-net support Windows RT?

2019-07-23 16:56发布

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.

2条回答
戒情不戒烟
2楼-- · 2019-07-23 17:36

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.

查看更多
ら.Afraid
3楼-- · 2019-07-23 17:53

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.

查看更多
登录 后发表回答