Adding a Project Reference to a Xamarin Forms App

跟風遠走 提交于 2021-01-29 11:26:07

问题


VS 2017 / C#.

I have a working Web and WebApi app. A web page accessing the WebApi (both written by me). I am now trying to create a Mobile App using Xamarin forms to call the WebApi. My mobile app needs access to a DTO project (part of my API). I can add the reference to the xxx.Android App, but I need to reference the DTO's in the xxx.Mobile App. There seems to be no option to add a reference in that 'shared' app. This means my code error's as it cannot find the DTO definitions.

Anyone have advice? Thanks.


回答1:


You should be able to right-click the Dependencies of the Forms project and add the reference.




回答2:


OK - slightly embarrassing, but will post in case others have this issue. There is no "References" under the Project. However, if you right-click the Project, there is an option to add a Reference. It then creates it.



来源:https://stackoverflow.com/questions/56371116/adding-a-project-reference-to-a-xamarin-forms-app

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