Splat [0.3.4] on Xamarin.iOS: issues with RectangleF and PointF

耗尽温柔 提交于 2019-12-12 14:28:01

问题


I'm trying to embrace the new PCL fun on a Xamarin.iOS project in Xamarin Studio. I created a PCL "Core" library for my project and added Splat (v0.3.4) via NuGet. Then, in a consuming iOS project, I reference my core library. Once I do that, a couple compile errors show up.

One of these:

Error CS0012: The type `System.Drawing.PointF' is defined in an assembly that is not referenced. Consider adding a reference to assembly `Splat.Portable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' (CS0012)

Multiple of these:

Error CS0029: Cannot implicitly convert type `System.Drawing.PointF [monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]' to `System.Drawing.PointF [Splat.Portable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]' (CS0029)

It looks like this was addressed in an pull request to Splat that landed since v0.3.4 hit NuGet. Following along with the notes there, I added a reference to Splat.Portable.dll to the iOS project. When I do, the compile errors change up to complain about too many type definitions.

Error CS0433: The imported type `System.Drawing.RectangleF' is defined multiple times (CS0433)
Error CS0433: The imported type `System.Drawing.PointF' is defined multiple times (CS0433)

Is it possible to work around these errors using Xamarin Studio 4.2.1 (Xamarin.iOS 7.0.4.209), and Splat 0.3.4 or do I need to build the latest code with its type-forwarding awesomeness?


回答1:


Yep, I'll build a new release of Splat tomorrow'ish, but building from source will also solve this.

Edit: Splat 1.0 is live and contains the fix for this bug




回答2:


Update Splat to the last version (1.6.2) - Splat 1.3.3 still have this issue.



来源:https://stackoverflow.com/questions/20385152/splat-0-3-4-on-xamarin-ios-issues-with-rectanglef-and-pointf

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