Microsoft KB Archive/922636

= You receive compiler warning messages and error messages when you try to convert the MapPoint Web Service SDK version 4.1 sample applications to Visual Studio 2005 projects =

Article ID: 922636

Article Last Modified on 9/6/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Express Edition

-



SYMPTOMS
When you try to convert the Microsoft MapPoint Web Service Software Development Kit (SDK) version 4.1 sample applications to Microsoft Visual Studio 2005 projects, you receive compiler warning messages and error messages. The errors prevent you from successfully building the sample applications.

For example, you may receive one or more compiler warning messages that resemble the following in the Error List window:

Warning message 1

Warning 1 Return type of function ‘ ’ is not CLS-compliant. C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\ImageMap\vb\App_Code\Global.asax.vb 147 30 C:\...\vb\

Warning message 2

Warning 1 The element 'compilation' has invalid child element 'compilers'. List of possible elements expected: 'assemblies, buildProviders, codeSubDirectories, expressionBuilders'.

Warning message 3

Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\ClickToCenterMap\cs\Form1.cs 188 22 ClickToCenterMapCS

In the Error List window, you may receive one or more error messages that resemble the following:

Error message 1

Error 1 Unable to open module file 'C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\ClickToCenterMap\vb\Web References\MapPointService\Reference.vb': The system cannot find the file specified. C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\ClickToCenterMap\vb\Web References\MapPointService\Reference.vb 1 1 ClickToCenterMapVB

Error message 2

Error 1 ERROR: Unable to get local copy of file web references\mappointservice\reference.vb.

Note You receive this error message when you open a sample Web application.

Error message 3

Error 1 A property or indexer may not be passed as an out or ref parameter C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\CoreFunctionality\Find\cs\App_Code\Find.aspx.cs 68 60 C:\...\cs\

Error 2 A property or indexer may not be passed as an out or ref parameter C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\CoreFunctionality\Find\cs\App_Code\Find.aspx.cs 123 50 C:\...\cs\

Error 3 A property or indexer may not be passed as an out or ref parameter C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\CoreFunctionality\Find\cs\App_Code\Find.aspx.cs 184 55 C:\...\cs\

Error 4 A property or indexer may not be passed as an out or ref parameter C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\CoreFunctionality\Find\cs\App_Code\Find.aspx.cs 303 50 C:\...\cs\

Error 5 A property or indexer may not be passed as an out or ref parameter C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples\CoreFunctionality\Find\cs\App_Code\Find.aspx.cs 352 50 C:\...\cs\

Note You receive this error message when you build the FindCS sample application.

Additionally, when you try to convert the LineDrive.sln solution and the TrafficIncidents.sln solution by opening the solution files in Visual Studio 2005, the Microsoft Visual Basic project and the Microsoft Visual C# project are unloaded in the solution. This problem occurs after the Visual Studio Conversion Wizard is finished.



CAUSE
Differences between the Visual C# language in Microsoft Visual Studio .NET 2003 and the Visual C# language in Visual Studio 2005 cause one of the error messages. The Visual Studio Conversion Wizard causes some of the error messages in Visual Basic solutions and in Visual C# solutions. Additionally, the Visual Studio 2005 conversion process deletes the Web references to MapPoint Web Service when you convert a Web application.



RESOLUTION
Two general types of sample applications are included in the MapPoint Web Service SDK. The two types are Web applications and stand-alone applications (executable applications). To resolve the compiler warning messages and the error messages that you receive when you try to convert the sample applications to Visual Studio 2005 projects, use the following methods.

Warning message 1
You can safely ignore this warning message. This warning message does not affect the sample applications.

To prevent this warning message, remove the following attribute from the Assembly.vb file.  Alternatively, set this attribute to False.

Warning message 2
You can safely ignore this warning message. This warning message does not affect the sample applications.

For more information, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/a15ebt6c.aspx

Warning message 3
You can safely ignore this warning message. This warning message does not affect the sample applications.

To prevent this warning message, replace every occurrence of the ConfigurationSettings.AppSettings property that is described in the Error List window with the ConfigurationManager.AppSettings property.

Error message 1
This error message is not related to the conversion process. However, you may receive this error message when you run the sample applications. All the sample applications have some mechanism to hard code the user name and the password for accessing the Web service. These credentials may be stored in the Web.config file, in the App.config file, or in other application program files. Make sure that these credentials are set to the Web service account ID and password for the account that you created on the MapPoint Web Service Customer Services site. These credentials are not the same credentials that you use to access your account management information.

To resolve this error message, follow these steps:
 * 1) In Solution Explorer, expand Web References.
 * 2) Right-click the Web service, and then click Update Web Reference.
 * 3) Rebuild the solution.

Note This error message occurs in the following sample applications:
 * ClickToCenterMap
 * DragPushpinOnMap
 * IconCollisionAndSuppression
 * PointConversion
 * Polygons
 * DataUploadClient

Error message 2
To resolve this error message, follow these steps:
 * 1) In Solution Explorer, right-click the project name, and then click Add Web Reference.
 * 2) In the URL box, type http://staging.mappoint.net/standard-30/mappoint.wsdl, and then click Go.
 * 3) In the Web reference name box, type the appropriate name from the table that appears after these steps, and then click Add Reference.
 * 4) Rebuild the project.

The following table lists the sample application names and the associated Web service names.

Error message 3
To resolve this error message, follow these steps:  Open the Find.aspx.cs file.  On line 68, change the existing code to the following code. PopulateListBox(ref listboxFindResults, myFindResults.Results);   On line 123, change the existing code to the following code. PopulateListBox(ref listboxFindResults, myFindResults.Results);   On line 184, change the existing code to the following code. PopulateListBox(ref listboxFindNearbyResults, myFindResults.Results );   On line 224, change the existing code to the following code. void PopulateListBox(ref System.Web.UI.WebControls.ListBox myListBoxControl, FindResult[] myResults)   On line 303, change the existing code to the following code. PopulateListBox(ref listboxFindResults, myFindResults.Results); </li>  On line 352, change the existing code to the following code. PopulateListBox(ref listboxFindResults, myFindResults.Results); </li> Rebuild the project.</li></ol>

Method to resolve the problem for the LineDrive.sln solution and for the TrafficIncidents.sln solution
To resolve this problem, convert the Visual Basic project and the Visual C# project by opening the .vbproj project file and the .csproj project file in Visual Studio 2005. Open these files instead of opening the .sln file.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

<div class="moreinformation_section">

Steps to reproduce the problem
<ol> Download the MapPoint Web Service SDK version 4.1. To do this, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?familyid=CB5148A9-F09E-4EC8-992F-16478C0B5D9A&displaylang=en

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.</li> Open the directory to which you downloaded the MapPointWebServiceSDK.exe file.</li> Double-click the MapPointWebServiceSDK.exe file.</li> Click Unzip, and then click OK when the file is unzipped.</li> In the Microsoft MapPoint Web Service SDK, Version 4.1 Setup Wizard, click Next, read and accept the license agreement, and then click Next.</li> On the Select Installation Folder page, click Next.</li> On the Confirm Installation page, click Next, and then click Close when the installation is complete.</li> Open the C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples directory.</li> Open one of the sample application directories, and then double-click the .sln file to open the solution in Visual Studio 2005.

Note If you have multiple versions of Visual Studio installed on the computer, right-click the .sln file, click Open With, and then click Microsoft Visual Studio Version Selector.</li></ol>

Additional query words: MapPoint Web Services VS 2005

Keywords: kberrmsg kbtshoot kbbug kbprb KB922636

-

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

© Microsoft Corporation. All rights reserved.