Does protobuf-net support Windows RT?

无人久伴 提交于 2019-12-11 10:07:55

问题


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.

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/13188142/does-protobuf-net-support-windows-rt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!