UWP app targeted only to Desktop/Tablet?

谁都会走 提交于 2019-12-13 07:01:40

问题


I'm trying to understand how UWP apps work. I'm looking at some third party libraries on NuGet, but some of them won't work with UWP due, I presume to missing dependencies.

For example, some PDF drawers need System.Drawing.dll which I presume may not be accessible on Windows Phone.

Given my app doesn't need to work on Phones, and it's arguably not even required for tablets... it's primarily a Desktop app... how can I get around these dependency issues?

Is there some way for me to still use these third party libraries; perhaps by choosing a setting to say not to target Windows Phone at all?


回答1:


To reduce your confusion I will try to provide straight information:

1) When developing UWP application you can define which Device Family you would like to support. You can do it in the app manifest - provide the information that you support only Desktop family:

<Dependencies>
 <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

This is very helpful link: https://msdn.microsoft.com/library/windows/apps/dn986903

There you can find the information how to support different device families: For instance for Mobile and Desktop you can put:

<Dependencies>
 <TargetDeviceFamily Name="Windows.Mobile" MinVersion="10.0.x.0" MaxVersionTested="10.0.y.0"/>
 <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.x.0" MaxVersionTested="10.0.y.0"/>
</Dependencies>

Second very important thing is that when you plan not support any mobile devices you do not have to create additional packages for the ARM architecture:

Last operation that you can do is to configure "Pricing and availability" in the Windows Store section when publishing your app:

Hope this will help.




回答2:


If I understood your question right, you're looking at building the UWP app specifically for certain targets (say desktops or mobile?)

Take a look at the TargetDeviceFamily configuration on your package manifest (Documentation here: link)

Also, check out this answer: Change what devices a UWP app targets



来源:https://stackoverflow.com/questions/38094184/uwp-app-targeted-only-to-desktop-tablet

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