开发者

Bing Maps APIs and Microsoft.Phone.Controls.Maps ambiguous Reference

I am facing a weird issue. I dont know whether this is an issue or not. Any help will be very much appreciated.

I am developing a map application. I already had a working code. Now i am trying to integrate it with another project. But when i add service reference to Bing Route and Geocode service i get the following issues.

The references.cs file which is开发者_如何学JAVA automatically generated contains this for the new project

 public partial class RequestBase : object, System.ComponentModel.INotifyPropertyChanged {

    private TourGuideApp.Bing.Route.Credentials CredentialsField;

while it this for the previous working project

public partial class RequestBase : object, System.ComponentModel.INotifyPropertyChanged {

    private Microsoft.Phone.Controls.Maps.Credentials CredentialsField;

The same is happening for Location field I have a new field Location in Bing Route service which is not present in the earlier project

  [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="Location", Namespace="http://dev.virtualearth.net/webservices/v1/common")]
[System.Runtime.Serialization.KnownTypeAttribute(typeof(TourGuideApp.Bing.Route.GeocodeLocation))]
[System.Runtime.Serialization.KnownTypeAttribute(typeof(TourGuideApp.Bing.Route.UserLocation))]
public partial class Location : object, System.ComponentModel.INotifyPropertyChanged {

so i was able to use Microsoft.Phone.Controls.Maps.Location .. but if i port the same code into the new project it says

'Location' is an ambiguous reference between 'Microsoft.Phone.Controls.Maps.Platform.Location' and 'TourGuideApp.Bing.Route.Location'

Similar thing is happening for credentials provider

I would be grateful for any help

Thanks and Regards Surya


This means that these dll-s both contain classes with the same name - in your case Location. What you need to do is where ever you are using the type Location you give the full reference.

Instead of:

private Location something;

you write

private Microsoft.Phone.Controls.Maps.Location something;

This way the compiler knows which Location you mean.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜