简体   繁体   中英

Cannot reference a class in portable project from UWP project

I am trying to reference a public class in my portable project from the UWP project but it does not allow me to.

Here is my project file structure:

[ 1]

Here is the class located in the portable project: 在此输入图像描述

Here is the class located in the UWP project, you'll notice it cannot access the class from the portable project: 在此输入图像描述

And here's what happens when I use the dot operator, the UWP namespace is the only thing that appears.

在此输入图像描述

Any ideas on why I cannot access the public class in the portable project? Or how I can access that class?

Thanks!

Thank you Ken Tucker your question shed light on the issue.

Windows 10 was not selected in the targets.

I did the following:

  • Uninstall Xamarin.Forms from the portable project using NuGet
  • Check the Windows 10 box in the targets of the portable project
  • Reinstall Xamarin.Forms to the portable project

Glad it was an easy solution!

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