Windows phone 7 我无法在wp7中创建ReverseGeocodeRequest instant

Windows phone 7 我无法在wp7中创建ReverseGeocodeRequest instant,windows-phone-7,Windows Phone 7,我正在wp7中使用地理编码服务从纬度和经度获取CountryName 我写了以下东西:- GeoCoordinate location1 = null; private GeoCoordinateWatcher watcher; public void FindCountryUsingGps() { progressbar.Visibility = Visibility.Visible; watcher = new GeoCoordinat

我正在wp7中使用地理编码服务从纬度和经度获取CountryName 我写了以下东西:-

GeoCoordinate location1 = null;
    private GeoCoordinateWatcher watcher;
    public void FindCountryUsingGps()
    {
        progressbar.Visibility = Visibility.Visible;
        watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);
        watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
        watcher.Start(); 

    }

    void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
    {
        if (watcher != null)
        {

            watcher.Stop();
            watcher.Dispose();
            watcher = null;

            location1 = e.Position.Location;
            ObtainCountry();//by this function you obtain country region
        }
    }
但是我不能写这个 ReverseGeocodeRequest ReverseGeocodeRequest=新的ReverseGeocodeRequest; 线,它是红色的


在wp7中,这是什么?

尝试删除/重新添加服务引用。有时我会遇到代码生成不正确的问题。代码应位于ServiceReference文件夹下,位于名为Reference.cs的代码文件中。

请提供更多信息。您是否添加了服务引用?是Bing地理编码服务还是其他什么?你试过什么?这是编译时错误吗?您确定添加服务引用生成了正确的代码吗?我有时会遇到一些问题,代码没有生成,或者是在我没有添加using for的命名空间中生成的。代码应该在ServiceReference文件夹下,在一个名为Reference.cs或类似的代码文件中。你说得对!我有时会遇到代码无法生成的问题:我创建了一个新项目,它正在工作:D:DGlad我可以帮忙。请在下面标出我的回答,以便其他路过的人也能找到。
public void ObtainCountry()
        {
            if (location == null)
                return;

            ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();