简体   繁体   中英

How to link third party dll from class library in Xamarin.iOS when using VS2012 and Build Host

I making a small cross platform project, and wan't my webservice calls, in a separate class library project. I've created a Xamarin.iOS solution, and added a class library, which is referenced from the application. In the class library, I've defined a simple webservice class that calls a webservice and deserializes the json into a POCO using Newtonsoft.Json. The problem is that because Newtonsoft.Json is referenced from the class library and not the application, the Newtonsoft.Json.dll file is not linked into the application - only the class library dll - and I get a file-not-found when deserializing. I tried to use --linkskip=Newtonsoft.Json in the application but that doesn't help.

How do I force the buildhost to link that dll into the application?

I finally found a solution. Since the linker don't care to embed the newtonsoft.json.dll in the solution, I add the file to the class library, besides referencing the one in the Component folder. That seems to work. No more "missing file"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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