Different code generation using upgraded Smart Device Project in Visual Studio 2008

We moved our smart device project from Visual Studio 2005 (VS2005) to Visual Studio 2008 (VS2008).

Everything worked after the upgrade except one odd thing: We have a ComboBox, which datasource is bound to a collection which type is provided by a webservice. The client side code to access the webservice was generated using the "Add Webreference" feature. If we start our application, the ComboBox is filled with the correct number of items provided by the datasource property, but every item shows only the name of the class (default ToString() behavior) and not the value, we provided in the DisplayMember property.

After some debugging, I found out, that setting the DisplayMember of the ComboBox has no effect. Retrieving the DisplayMember property gave us a nothing/null value. The reason for this was the designer generated code, which can be found in the Reference.vb file.

All properties which we had in the file turned into public fields! We had no compile time errors, but at runtime we now tried to set the DisplayMember of our ComboBox to a public field, instead of a public property. I'm not sure if it is working on a Windows Application if you set the DisplayMember to a public field, but on the Compact Framework it is not working!

The curious thing is, that if you create a new Project in VS2008 and add the same webservice as a reference, all the properties are generated as expected.

I have no solution to this problem yet, but it's a serious issue, if you hav e to move a lot of VS2005 projects to VS2008 and update the Webreferences becaus e there are no compile-time warnings or errors.

There is a workaround. Use wsdl.exe to generate your client-side stubs and then edit the code as mentioned on msdn.

I'll updated this post as soon as we have a solution for that problem.

Update: Solved this issue. See here

Louis Haußknecht

Software developer, tech enthusiast.

Overath, Germany