You receive a "Unable to generate a serializer" error message when you drag a user control onto a form (815251)
The information in this article applies to:
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
SYMPTOMSIn Microsoft Visual Studio .NET, when you drag a user
control onto a form, and the user control consumes a Web service with a Web
Service method that has a Typed DataSet as a parameter or as a return type, you
receive the following error: Unable to generate a
serializer for type UserControlName.WebServerName.DataSetName from assembly
<Unknown> because the assembly may be dynamic. Save the assembly and load
it from disk to use it with XmlSerialization. You receive the error
only if the user control instantiates the Web service when you drag the user
control onto the form. CAUSETo use Typed DataSets, the XML Serializer must have
additional serialization information about the Typed DataSets schema. When you
create a Web service with a Web Service method, and you have a Typed DataSet as
a parameter or as a return type, the serialization information is built into
the Web service. When you add a Web Reference to this Web
service in a user control project, the serialization information is built into
the auto-generated Web Service Proxy file. However, when the user control is
added to the toolbox in a project, the project has no reference to the Proxy
file. Therefore, Visual Studio .NET cannot obtain the serialization information
for the Typed DataSet. Without this serialization information, you receive the
error mentioned in the "Symptoms" section of this article.WORKAROUNDTo work around this bug, follow these steps:
- In the Windows Application project, click to select the
UserControlName.dll assembly under
References, and then press the F4 key to display the
properties.
- Click to select the Copy Local property,
and then set the value to False.
- Drag the user control onto the form.
You do not
receive an error message.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
This bug was corrected in Microsoft Visual Studio .NET (2003).
REFERENCESFor additional information, visit the following Microsoft
Web sites: For additional information, click the
following article numbers to view the articles in the Microsoft Knowledge Base:
313486
INFO: Roadmap for Visual Database Tools and Typed DataSets
315678 HOW TO: Create and Use a Typed DataSet by Using Visual Basic .NET
320714 HOW TO: Create and Use a Typed DataSet by Using Visual C# .NET
Modification Type: | Major | Last Reviewed: | 1/23/2006 |
---|
Keywords: | kbvs2005swept kbvs2005doesnotapply kbide kbDragDrop kbfix kbControl kbWebServices KB815251 kbAudDeveloper |
---|
|