将项目引用添加到 Xamarin Forms 应用程序 [英] Adding a Project Reference to a Xamarin Forms App

查看:30
本文介绍了将项目引用添加到 Xamarin Forms 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VS 2017/C#.

我有一个可用的 Web 和 WebApi 应用程序.访问 WebApi 的网页(均由我编写).我现在正在尝试使用 Xamarin 表单创建一个移动应用程序来调用 WebApi.我的移动应用程序需要访问 DTO 项目(我的 API 的一部分).我可以添加对 xxx.Android 应用程序的引用,但我需要在 xxx.Mobile 应用程序中引用 DTO.似乎没有选项可以在该共享"应用程序中添加引用.这意味着我的代码错误,因为它找不到 DTO 定义.

有人给点建议吗?谢谢.

解决方案

您应该能够右键单击 Forms 项目的 Dependencies 并添加引用.

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.

解决方案

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

这篇关于将项目引用添加到 Xamarin Forms 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆