简体   繁体   English

我可以有一个带有PCL和共享代码的Xamarin.Forms项目吗?

[英]Can I have a Xamarin.Forms project with PCLs and shared code?

UPDATE: I realized where my confusion came from. 更新:我意识到我的困惑来自哪里。

You can start a project with PCLs, then turn it into a shared project, but you cannot start with a shared project then add PCLs. 您可以使用PCL启动一个项目,然后将其转换为共享项目,但是不能先启动共享项目,然后添加PCL。


I understand the differences between PCL and Shared in Xamarin, as well as Xamarin native (iOS, Android) vs Shared. 我了解PCa和Xamarin中的Shared以及Xamarin本机(iOS,Android)与Shared之间的区别。 There is a great comparison on it here. 这里有一个很好的比较。

What I am not sure of, is if I can use PCLs and shared code in the same project. 我不确定的是,是否可以在同一项目中使用PCL和共享代码。 For example, if I want to work on a project which require a plugin, such as plugin.media, how can I also use blob storage, with the Azure.Storage namespace, if that requires shared code? 例如,如果我想在需要插件的一个项目工作,如plugin.media,我怎么使用Blob存储,与Azure.Storage命名空间,如果需要共享代码?

Yes. 是。 You can reference both a PCL and a Shared Project (shproj) from the same project. 您可以引用同一项目中的PCL和共享项目(shproj)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM