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
SYMPTOMSWhen 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 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 1 The element 'compilation' has invalid child element 'compilers'. List of possible elements expected: 'assemblies, buildProviders, codeSubDirectories, expressionBuilders'. 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 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 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 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. CAUSEDifferences 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.RESOLUTIONTwo 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 messagesWarning message 1You 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 2You 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 3You 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 messagesError message 1This 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:
- In
Solution Explorer, expand Web References.
- Right-click the Web service, and then click
Update Web Reference.
- Rebuild the solution.
Note This error message occurs in the following sample applications: - ClickToCenterMap
- DragPushpinOnMap
- IconCollisionAndSuppression
- PointConversion
- Polygons
- DataUploadClient
Error message 2To resolve this error message, follow these steps:
- In Solution Explorer, right-click the
project name, and then click Add Web Reference.
- In the URL box, type
http://staging.mappoint.net/standard-30/mappoint.wsdl,
and then click Go.
- In the Web reference name
box, type the appropriate name from the table that appears after these steps, and then click Add Reference.
- Rebuild the project.
The following
table lists the sample application names and the associated Web service names.
|
FindCS | CoreFunctionality.MapPointService | FindVB | CoreFunctionality.MapPointService | FindAddressVB | FindAddressVB.MapPointService | FindAddressCS | FindAddressCS.MapPointService | FindNearbyVB | FindNearbyVB.MapPointService | FindNearbyCS | FindNearbyCS.MapPointService | FindNearRouteCS | CoreFunctionality.MapPointService | FindNearRouteVB | CoreFunctionality.MapPointService | MapWithNavigationButtonsVB | MapWithNavigationButtonsVB.MapPointService | MapWithNavigationButtonsCS | MapWithNavigationButtonsCS.MapPointService | RouteVB | RouteVB.MapPointService | RouteCS | RouteCS.MapPointService | ImageMapCS | ImageMap.MapPointService | ImageMapVB | ImageMap.MapPointService | InsetOverviewCS | InsetOverviewCS.MapPointService | InsetOverviewVB | InsetOverviewVB.MapPointService | LineDriveCS | LineDriveCS.MapPoint | LineDriveVB | LineDriveVB.MapPoint | PocketIECS | PocketIECS.MapPointService | PocketIEVB | PocketIEVB.MapPointService | PanMapNavigationControlCS | PanMapNavigationControlCS.MapPointService | PanMapNavigationControlVB | PanMapNavigationControlVB.MapPointService | StoreLocatorCS | StoreLocatorCS.MapPointService | StoreLocatorVB | StoreLocatorVB.MapPointService | TrafficIncidentsCS | TrafficIncidentsCS.MapPoint | TrafficIncidentsVB | TrafficIncidentsVB.MapPoint | TurnByTurnRouteMapsCS | TurnByTurnRouteMapsCS.MapPointService | TurnByTurnRouteMapsVB | TurnByTurnRouteMapsVB.MapPointService |
Error message 3To 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); - On line 352, change the existing code to the following code.
PopulateListBox(ref listboxFindResults, myFindResults.Results); - Rebuild the project.
Method to resolve the problem for the LineDrive.sln solution and for the TrafficIncidents.sln solutionTo 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. STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 9/6/2006 |
---|
Keywords: | kbBug kberrmsg kbtshoot kbprb KB922636 kbAudDeveloper |
---|
|