PRB: "Identifier Expected" Error Message When You Compile an Upgraded Visual C# .NET Project (821173)
The information in this article applies to:
- Microsoft Visual J++ 6.0
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSYou can use Java Language Conversion Assistant (JLCA) to
convert your Visual J++ projects and Java code to Visual C# .NET code. However,
if you do the following, you receive an error message: - Convert your Visual J++ project to Visual C# .NET by using JLCA.
- Add a new item (such
as a Web Form or a Class) to the generated Visual C# .NET project.
- Try to build the project.
You receive the
following compiler error message: error BC30203: Identifier
expected Note You may also notice a red error indicator mark (or squiggly) after the namespace keyword in the code. CAUSEThis behavior occurs because the wizard cannot assign a value to the RootNamespace namespace. When JLCA converts the Visual J++ project, JLCA generates a project file (for example, ProjectName.csproj) that contains project settings for the Visual C# .NET project. However, the JLCA tool does not assign a value for the RootNamespace namespace in the project file because the tool cannot identify the namespace value for the class that the wizard generates.RESOLUTIONTo resolve this problem, type the namespace in the project
properties as follows: - Before you add a new item to the project, type the value for
Default namespace in Properties for the project. To do this, follow these steps:
- In Solution Explorer of Visual
Studio .NET, right-click the generated project name, and then click
Properties.
- In the Default
Namespace text box, type the value for namespace.
- Click OK.
-or- - Before you add a new item to the project, type the value
for RootNamespace in the project file. To do this, follow these steps:
- Start a text editor such as Notepad.
- In the text editor, open the project file of the generated Visual C#
project.
- In the project file, type the value for RootNamespace.
- Save the project file.
STATUS This
behavior is by design.REFERENCESFor more information about JLCA, visit the following Microsoft
Web site:
Modification Type: | Major | Last Reviewed: | 5/28/2003 |
---|
Keywords: | kberrmsg kbUpgrade kbMiscTools kbCodeGen kbWndwClass kbWindowsForms kbprb KB821173 kbAudDeveloper |
---|
|