You receive error messages when Visual Studio 2005 upgrades MapPoint Web Service SDK 4.1 sample projects (920965)



The information in this article applies to:

  • Microsoft Visual Studio 2005 Team System Architect Edition
  • Microsoft Visual Studio 2005 Team System Developer Edition
  • Microsoft Visual Studio 2005 Team System Test Edition
  • Microsoft Visual Studio 2005 Team System Team Foundation:
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Express Edition
  • MapPoint .NET

SYMPTOMS

Consider the following scenario. You download Microsoft MapPoint Web Service Software Development Kit (SDK) version 4.1. You open one of the MapPoint Web Service SDK sample projects in Microsoft Visual Studio 2005. In this scenario, when Visual Studio 2005 upgrades the sample project, you receive various error messages. For example, you may receive the following error message:
ERROR: Unable to get local copy of file web references\mappointservice\reference.cs.
Additionally, if you try to compile the sample project, you receive various compilation error messages.

CAUSE

Some of the error messages occur because Visual Studio 2005 includes new language features for Microsoft Visual C# and for Microsoft Visual Basic. These new language features are not present in earlier versions of Visual Studio. Other error messages occur because the Visual Studio 2005 Upgrade Wizard does not correctly convert the MapPoint Web Service SDK sample projects.

RESOLUTION

To resolve these problems, use one or more of the following methods.

Notes
  • You may have to use several of these methods to make a sample project or solution compile successfully.
  • The Visual Studio 2005 Upgrade Wizard does not correctly convert the LineDrive solution or the TrafficIncidents solution. You must build the Visual C# and Visual Basic projects in these solutions separately by using method 2.

Method 1: Update Web references

You must update the Web references for the projects that are in the following solutions:
  • ClickToCenterMap
  • DataUploadClient
  • DragPushpinOnMap
  • IconCollisionAndSuppression
  • PointConversion
  • Polygons
To do this, follow these steps:
  1. Start Visual Studio 2005.
  2. On the File menu, point to Open, and then click Project/Solution.
  3. Locate the solution (.sln) file that you want to open, and then click Open.
  4. In Solution Explorer, expand Web References for the Visual C# and Visual Basic projects.
  5. Under Web References, right-click MapPointService, and then click Update Web Reference.
  6. Right-click the project, and then click Rebuild Solution.

Method 2: Add Web references that are missing

You must add Web references to the Visual C# and Visual Basic projects that are in the following folders:
  • CoreFunctionality
  • ImageMap
  • InsetOverviewMap
  • LineDrive
  • MobileApplications
  • PanMapNavigationControl
  • StoreLocator
  • TrafficIncidents
  • TurnByTurnRouteMaps
To do this, follow these steps:
  1. Start Visual Studio 2005.
  2. On the File menu, point to Open, and then click Project/Solution.
  3. Locate the project file (.csproj or .vbproj) that you want to open, and then click Open.
  4. In Solution Explorer, right-click the name of the project, and then click Add Web Reference.
  5. In the URL box, type the following URL:

    http://staging.mappoint.net/standard-30/mappoint.wsdl

  6. Click Go.
  7. After Visual Studio 2005 locates the Web service, type the correct Web reference name in the Web reference name box. Use the following table to determine the correct Web reference name for the sample project.
    Project nameWeb reference name
    FindCSCoreFunctionality.MapPointService
    FindVBCoreFunctionality.MapPointService
    FindAddressCSFindAddressCS.MapPointService
    FindAddressVBFindAddressVB.MapPointService
    FindNearbyCSFindNearbyCS.MapPointService
    FindNearbyVBFindNearbyVB.MapPointService
    FindNearRouteCSCoreFunctionality.MapPointService
    FindNearRouteVBCoreFunctionality.MapPointService
    MapWithNavigationButtonsCSMapWithNavigationButtonsCS.MapPointService
    MapWithNavigationButtonsVBMapWithNavigationButtonsVB.MapPointService
    RouteCSRouteCS.MapPointService
    RouteVBRouteVB.MapPointService
    ImageMapCSImageMap.MapPointService
    ImageMapVBImageMap.MapPointService
    InsetOverviewCSInsetOverviewCS.MapPointService
    InsetOverviewVBInsetOverviewVB.MapPointService
    LineDriveCSLineDriveCS.MapPoint
    LineDriveVBLineDriveVB.MapPoint
    PocketIECSPocketIECS.MapPointService
    PocketIEVBPocketIEVB.MapPointService
    PanMapNavigationControlCSPanMapNavigationControlCS.MapPointService
    PanMapNavigationControlVBPanMapNavigationControlVB.MapPointService
    StoreLocatorCSStoreLocatorCS.MapPointService
    StoreLocatorVBStoreLocatorVB.MapPointService
    TrafficIncidentsCSTrafficIncidentsCS.MapPoint
    TrafficIncidentsVBTrafficIncidentsVB.MapPoint
    TurnByTurnRouteMapsCSTurnByTurnRouteMapsCS.MapPointService
    TurnByTurnRouteMapsVBTurnByTurnRouteMapsVB.MapPointService
  8. Click Add Reference.
  9. Right-click the project, and then click Rebuild Solution.

Method 3: Modify function parameters in the Find C# project

When you try to compile the Find C# project in the CoreFunctionality folder after you use the previous methods, you receive several error messages that resemble the following:
A property or indexer may not be passed as an out or ref parameter.
To resolve this problem, follow these steps:
  1. Start Visual Studio 2005.
  2. On the File menu, point to Open, and then click Project/Solution.
  3. Locate the Find C# project, and then click Open.
  4. In Solution Explorer, double-click Find.aspx.cs.
  5. On the Edit menu, click Go To.
  6. In the Line number box, type 224, and then click OK.
  7. Replace the existing code as follows.

    Existing code
    void PopulateListBox(ref System.Web.UI.WebControls.ListBox myList BoxControl, ref FindResult[] myResults)
    Replacement code
    void PopulateListBox(ref System.Web.UI.WebControls.ListBox myList BoxControl, FindResult[] myResults)
  8. By using the procedures in steps 5 and 6, locate the following lines of code, and then replace them as follows.

    Line 68: Existing code
    PopulateListBox(ref listboxFindResults, ref myFindResults.Results);
    Line 68: Replacement code
    PopulateListBox(ref listboxFindResults, myFindResults.Results);


    Line 123: Existing code
    PopulateListBox(ref listboxFindResults, ref myFindResults.Results);
    Line 123: Replacement code
    PopulateListBox(ref listboxFindResults, myFindResults.Results);


    Line 184: Existing code
    PopulateListBox(ref listboxFindNearbyResults,ref myFindResults.Results );
    Line 184: Replacement code
    PopulateListBox(ref listboxFindNearbyResults, myFindResults.Results );


    Line 303: Existing code
    PopulateListBox(ref listboxFindResults, ref myFindResults.Results);
    Line 303: Replacement code
    PopulateListBox(ref listboxFindResults, myFindResults.Results);


    Line 352: Existing code
    PopulateListBox(ref listboxFindResults, ref myFindResults.Results);
    Line 352: Replacement code
    PopulateListBox(ref listboxFindResults, myFindResults.Results);
  9. Right-click the project, and then click Rebuild Solution.

MORE INFORMATION

You can download MapPoint Web Service SDK 4.1. To do this, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:7/26/2006
Keywords:kbtshoot kbprb KB920965 kbAudDeveloper