Add Portable Class Library (in DLL form) to Xamarin Studio

荒凉一梦 提交于 2021-02-07 05:43:15

问题


I have built a Portable Class Library with Visual Studio 2012 that will also build in Xamarin Studio. I would like to add the DLL built from that PCL (from the bin directory of the solution) to an existing (Android app) project in Xamarin Studio 5.3.

I notice that according to documentation from Xamarin, this is generally possible. For example, from this page:

The output from a PCL (ie. the resulting assembly DLL) can also be added as a reference to most projects. This makes PCL an ideal way to ship cross-platform components and libraries.

If I simply right click in the solution tree and add the file, this does not seem to be usable by the project.

What is the correct way to add this resulting DLL based on a PCL to my Xamarin project?


回答1:


If you look under the solution explorer on the left, you can right click on References and select Edit References. Then go to .Net Assembly and Browse to navigate to the desired *.dll file. Select the file and click Add.

This is the simplest way there may be more

  1. Right click References

  1. Click .Net Assembly

  1. Choose Browse (at the bottom right of dialog)




回答2:


I missed it at first too. In the bottom right of .NET Assemblies, there's a "Browse" button. :)




回答3:


I'm not familiar with Xamarin, but I'm pretty sure that there is an option to import/add references.

Under Edit References you may select an type (.net assemblies for example), and pick your dll.

regards



来源:https://stackoverflow.com/questions/25670152/add-portable-class-library-in-dll-form-to-xamarin-studio

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