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 (922636)



The information in this article 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 'FunctionName' 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.

Methods to resolve the compiler warning messages

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.
<Assembly: CLSCompliant(True)>
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:

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.

Methods to resolve the error messages

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.
Sample applicationWeb service name
FindCSCoreFunctionality.MapPointService
FindVBCoreFunctionality.MapPointService
FindAddressVBFindAddressVB.MapPointService
FindAddressCSFindAddressCS.MapPointService
FindNearbyVBFindNearbyVB.MapPointService
FindNearbyCSFindNearbyCS.MapPointService
FindNearRouteCSCoreFunctionality.MapPointService
FindNearRouteVBCoreFunctionality.MapPointService
MapWithNavigationButtonsVBMapWithNavigationButtonsVB.MapPointService
MapWithNavigationButtonsCSMapWithNavigationButtonsCS.MapPointService
RouteVBRouteVB.MapPointService
RouteCSRouteCS.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

Error message 3

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

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.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

  1. Download the MapPoint Web Service SDK version 4.1. To do this, visit the following Microsoft Web site: 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.
  2. Open the directory to which you downloaded the MapPointWebServiceSDK.exe file.
  3. Double-click the MapPointWebServiceSDK.exe file.
  4. Click Unzip, and then click OK when the file is unzipped.
  5. In the Microsoft MapPoint Web Service SDK, Version 4.1 Setup Wizard, click Next, read and accept the license agreement, and then click Next.
  6. On the Select Installation Folder page, click Next.
  7. On the Confirm Installation page, click Next, and then click Close when the installation is complete.
  8. Open the C:\Program Files\Microsoft MapPoint Web Service SDK, Version 4.1\Samples directory.
  9. 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.

Modification Type:MinorLast Reviewed:9/6/2006
Keywords:kbBug kberrmsg kbtshoot kbprb KB922636 kbAudDeveloper