Microsoft KB Archive/834062

= The Software Development Kit WinTalk sample cannot be opened in Design view in Visual Studio .NET =

Article ID: 834062

Article Last Modified on 2/9/2006

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft Visual C# .NET 2002 Standard Edition

-





SYMPTOMS
WinTalk is a Microsoft Visual Studio .NET Software Development Kit (SDK) sample. When you try to open the WinTalk sample in Design view in Visual Studio .NET, you may receive the following error message:

An error occured while loading the document. Fix the error, and try loading the document again. The error message follows:

The class TalkForm can be designed, but is not the first class in the file. Visual studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.

Note In this error message, the word &quot;occured&quot; is misspelled with one &quot;r&quot;.



CAUSE
To design the form, the Design view of the form uses the first class that is in the Code view of the form. If the TalkForm class that is used to design the form is not at the beginning of the Code view of the form, you may receive the error message that is mentioned in the &quot;Symptoms&quot; section.



WORKAROUND
To work around this problem, follow these steps:  Locate the WinTalk folder. Open a Visual Basic .NET project in the WinTalk folder. In Microsoft Solution Explorer, click the WinTalk.vb file. On the View menu, click Code.

The Code view of the form appears.

'''

Note''' The Code view of the form has three classes. The three classes are:  The App class The TalkForm class The Talker class</li></ul>

The TalkForm class inherits from the Form class.</li>  Locate the following code in the WinTalk.vb file: Imports Microsoft.VisualBasic </li> Move the code that corresponds to the TalkForm class and then put that code below the code that you located in the step 4.

The WinTalk form Designer view opens without error.</li></ol>

<div class="moreinformation_section">

Steps to reproduce the problem

 * 1) Start Visual Studio .NET.
 * 2) On the File menu, point to Open, and then click Project.

The Open Project dialog box appears.
 * 1) In the Look in box, click the WinTalk project.

Note The Visual Basic .NET version of the WinTalk project is typically located at C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Applications\WinTalk\vb.

The Microsoft Visual C# .NET version of the WinTalk project is typically located at C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Applications\WinTalk\cs.
 * 1) Locate the WinTalk\VB folder, and then click the WinTalkVb.sln file.
 * 2) Click Open.
 * 3) In Solution Explorer, double-click WinTalk.vb.

You may receive the error message that is mentioned in the &quot;Symptoms&quot; section.

<div class="references_section">