Which DLL has the Windows.Devices.Gelocation namespace?

柔情痞子 提交于 2019-12-02 12:07:42

问题


I'm using VS 2012 and I need to write code that uses the classes in the Windows.Devices.Gelocation namespace. I downloaded the sample program but it won't load in VS2012 as it requires VS 2013. And the documentation for the class does not indicate which DLL that namespace is in.

Can someone tell me which DLL contains that namespace? Is it available in .NET 4 or do I have to use .NET 4.5?

Edit

My project is a console application which runs in the background as a Windows service. The searching I've done indicates that I have to target Windows 8 by using the Reference Manager's Windows Tab. But there is no Windows tab in the Reference Manager in my project because it's not a Windows Store application. Is there a way to use this API from a desktop application???


回答1:


I've found how to reference the assembly I need.

On this page, under the section Windows Tab, in the Core Subgroup subsection, the third paragraph gives instructions on how to reference the needed windows assemblies from desktop applications. To summarize it:

  1. Unload the project to which the reference will be added.
  2. Edit the .csproj file for the project.
  3. Add the following snippet anywhere in the .csproj file:

       <PropertyGroup>
         <TargetPlatformVersion>8.0</TargetPlatformVersion>
       </PropertyGroup>

  4. Save the edited .csproj file.

  5. Reload the project.

At this point, when you open the Reference Manager dialog, you'll see a Windows tab on the left. Click that, and you'll see the Core subgroup. To the right, it'll say "Targeting Window 8.0" and under that "Windows version 255.255.255.255" will be unchecked. Check it off then click OK & you're done.



来源:https://stackoverflow.com/questions/22227263/which-dll-has-the-windows-devices-gelocation-namespace

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