问题
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