Microsoft KB Archive/920965

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

Article ID: 920965

Article Last Modified on 7/26/2006

-

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 Foundation
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Express Edition
 * Microsoft MapPoint Web Service 1.0

-





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:  Start Visual Studio 2005. On the File menu, point to Open, and then click Project/Solution. Locate the project file (.csproj or .vbproj) that you want to open, and then click Open. In Solution Explorer, right-click the name of the project, and then click Add Web Reference. In the URL box, type the following URL:

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

 Click Go.</li> 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. </li> Click Add Reference.</li> Right-click the project, and then click Rebuild Solution.</li></ol>

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: <ol> Start Visual Studio 2005.</li> On the File menu, point to Open, and then click Project/Solution.</li> Locate the Find C# project, and then click Open.</li> In Solution Explorer, double-click Find.aspx.cs.</li> On the Edit menu, click Go To.</li> In the Line number box, type 224, and then click OK.</li>  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) </li>  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); </li> Right-click the project, and then click Rebuild Solution.</li></ol>

<div class="moreinformation_section">

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

http://www.microsoft.com/downloads/details.aspx?FamilyID=cb5148a9-f09e-4ec8-992f-16478c0b5d9a

Keywords: kbtshoot kbprb KB920965

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.