为什么我不能在我的应用程序中引用Bing地图? [英] Why can I not reference Bing Maps in my app?

查看:85
本文介绍了为什么我不能在我的应用程序中引用Bing地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过右键单击参考|在我的应用程序中添加对Bing地图的引用.添加参考| Windows |扩展| Bing Maps for C#... ,但是选择确定"不会执行任何操作-未添加引用.

I tried to add a Reference to Bing Maps in my app by right-clicking on References | Add References | Windows | Extensions | Bing Maps for C#..., but selecting "OK" does nothing - the Reference is not added.

然后我尝试通过工具添加它|扩展和更新,但是当我安装最新版本(今天是2012年11月5日)时,我得到了:

I then tried adding it via Tools | Extensions and Updates, but when I installed the latest version (with today's date - 11/5/2012), I then got:

Successfully installed 'BingMapAppSDK 1.0.1011.1716'.
Successfully uninstalled 'BingMapAppSDK 1.0.1011.1716'.
Install failed. Rolling back...
Could not install package 'BingMapAppSDK 1.0.1011.1716'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.

现在那里的按钮(在工具|扩展和更新| Bing Maps SDK for C#... 中显示卸载",因此显然已安装,但是为什么不能在我的参考中添加引用项目?

Now the button there (at Tools | Extensions and Updates | Bing Maps SDK for C#... says "Uninstall" so it is apparently installed, but why can I not add the Reference to my project?

不仅仅是Bing Maps不能将自身添加到我项目的References中;当我尝试添加"Microsoft Visual C ++运行时程序包"时,也不会添加它;当我选择它时没有错误消息,它根本不会被添加...

It's not just Bing Maps that won't let itself be added to my project's References; when I try to add "Microsoft Visual C++ Runtime Package," it also will not be added; there's no err msg when I select it, it simply doesn't get added...

我有另一个项目,其中安装了"C#必应地图..."作为参考.为什么一个人能工作而另一个人不工作的原因既是难题,又是恼怒.

I have another project which has "Bing Maps for C#..." installed as a Reference. Why that one would work and the other one not is both a conundrum and an irritation.

根据已安装的扩展和更新| SDK ,在工作的项目中,唯一安装的Bing Maps SDK是用于JavaScript的...但是我的项目确实有对"Bing Maps for CE,C ++或VB"的引用... ???

The bizarre thing is that, according to Extensions and Updates Installed | SDKs, in the working project the only Bing Maps SDK installed is the one for JavaScript... and yet my project does have a Reference to "Bing Maps for CE, C++, or VB"...???

但是,如果我要转到扩展和更新|在线| Visual Studio Gallery 并搜索必应地图",搜索结果包含带有绿色复选标记的"Bing Maps SDK for Windows Store应用程序".

Yet if I go to Extensions and Updates | Online | Visual Studio Gallery and search for "bing maps" the search results contains "Bing Maps SDK for Windows Store apps" with a green check, indicating it is installed.

可以是我的项目的配置吗?有效的项目已设置为Debug,x86.无效的设置为调试,任何CPU ... ???

Could it be my project's configuration? The project that works is set for Debug, x86. The one that doesn't work is set to Debug, Any CPU...???

如果我做错了什么,为什么过滤到:SDK适用于(除其他外)显示" C#,C ++或VB的必应地图"?

And if I'm doing something wrong, why is the "Filtered to: SDKs applicable to displaying (among other things) "Bing Maps for C#, C++, or VB"?

爱荷华州,我很高兴它可以使用,但是不允许添加它... argghhhh !!!

IOW, it's teasing me that it's available, but won't allow it to be added...argghhhh!!!

也许这可能是我的问题的线索:在工具|扩展和更新,Windows Store应用程序的Bing Maps SDK出现在工具"类别中,而SKDK类别(尽管Bing Maps SDK for JavaScript)出现在SDK类别中.

Maybe this could be a clue to my problem: In Tools | Extensions and Updates, Bing Maps SDK for Windows Store apps appears in the "Tools" category as opposed to the SKDKs category (although Bing Maps SDK for JavaScript) is in the SDKs category...

根据Mayank的建议,我尝试浏览并添加.dll

Based on Mayank's suggestion, I tried to browse to and add the .dll

那不仅行不通,而且还给了我一个错误消息:

That not only didn't work, but also gave me an err msg:

"对C:\ Users \ Clay \ AppData \ Local \ Microsoft SDKs \ Windows \ v8.0 \ ExtensionSDKs \ Bing.Maps.Xaml \ 1.0 \ DesignTime \ CommonConfiguration \ x86 \ Bing.Maps的引用.无法添加"Design.dll".该项目的目标是".NETCore",而文件引用的目标是".NETFramework".这不是受支持的方案.

如果这确实是问题,如何从.NETCore切换到.NETFramework?我确定我没有在任何时候为该项目明确选择.NETCore ...

If this is truly the problem, how do I switch from .NETCore to .NETFramework? I'm certain I did not explicitly choose .NETCore at any time for this project...

在其他地方,有人建议我将适用于Bing Maps的应用程序的.csproj文件与不适用于Bing Maps的应用程序进行比较.这是我想出的:

Elsewhere somebody suggested I compare the .csproj files of an app that does work with the Bing Maps and the one that doesn't. Here's is what I have come up with:

我注意到与Bing Maps兼容的应用程序在.csproj文件中具有此功能,而另一个则没有:

I noticed that the app that IS working with Bing Maps has this in the .csproj file, whereas the other one doesn't:

<Compile Include="DataModel\SampleDataSource.cs" />
    <Compile Include="Common\BindableBase.cs" />
    <Compile Include="Common\BooleanToVisibilityConverter.cs" />
    <Compile Include="Common\BooleanNegationConverter.cs" />
    <Compile Include="Common\LayoutAwarePage.cs" />
    <Compile Include="Common\RichTextColumns.cs" />
    <Compile Include="Common\SuspensionManager.cs" />
    <Compile Include="SQLite.cs" />
    <Compile Include="SQLiteAsync.cs" />
    <Compile Include="ViewModel\StorageUtils.cs" />
    <Compile Include="View\SectionN.xaml.cs">
      <DependentUpon>SectionN.xaml</DependentUpon>
    </Compile>

...虽然很好奇(为什么其中一个包含所有这些文件,而另一个不包含这些文件?),但我不明白为什么这会成为问题.

...although curious (why does one include all of those files, and the other doesn't?), I don't see why this would be a problem.

此外,正在运行的应用程序还包含以下内容:

Also, the working app contains this:

</PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'TSLsARM|
AnyCPU'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\TSLsARM\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
. . .

更新5

这是对JuStDaN的回应:

UPDATE 5

This is in response to JuStDaN:

两种解决方案(具有适用于Windows应用商店的必应地图的

Both solutions (the one that has the Bing Maps for Windows Store apps

引用,而不会接受的引用)引用".NET for

reference, and the one that won't accept it) references the ".NET for

"Windows应用商店应用" SDK,具有以下属性设置:

Windows Store apps" SDK, with these property settings:

Identity = .NETCore,Version=v4.5; 
Version=4.5.0.0; 
Path=C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\

都具有Application.Target framework = blank;输出:Windows应用商店应用 Application.Build.Configuration =活动(调试);平台:有效(x86)

Both have Application.Target framework=blank; Output: Windows Store app Application.Build.Configuration=Active (Debug); Platform: Active (x86)

我至少还有其他两种不会接受新引用的解决方案.就像是Windows必应地图的Bing Maps参考安装了一次,然后又拒绝了……

I have at least a couple of other solutions that won't accept new references, either. It's as if the Bing Maps for Windows Store reference installed once, and then refused to ever again...

推荐答案

必须选中该复选框.

对我来说如此显而易见,但不可见"-似乎选择该项目应该已经足够,而且我没有注意/没有看到"该复选框.也许不应该在没有选择/检查任何内容的情况下选择确定"?还有提示您选中复选框的提示?

So obvious, yet "invisible" to me - it seemed selecting the item should have been enough, and I paid no attention to/didn't "see" the checkbox. Perhaps one shouldn't be allowed to select "OK" with nothing selected/checked? And a hint telling you to check a checkbox?

这是答案:

http://social.msdn.microsoft.com/Forums/zh-CN/toolsforwinapps/thread/075ba866-fd8b-41d3-ab5e-a3c0812ab430

这篇关于为什么我不能在我的应用程序中引用Bing地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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