Microsoft KB Archive/907754

= A new project contains build errors when you use a template that you exported from a project if the name of the old project contains space characters or other invalid identifying characters in Visual Studio 2005 =

Article ID: 907754

Article Last Modified on 2/9/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Express Edition

-





SYMPTOMS
Consider the following scenario. In Microsoft Visual Studio 2005, the name of a Microsoft Visual Basic Windows Application project contains space characters or other invalid identifying characters. You export a template from the project. You create a new project by using the exported template. In this scenario, the new project contains the following build errors:

'Data_Project' is not a member of ''

Type 'Data_Project.My.MySettings' is not defined.



CAUSE
This problem occurs because certain code elements require the name to be embedded as a safe name. These code elements may include namespace issues. For example, when you name your project &quot;Data Project,&quot; you notice the code Global.Data_Project in the Application.designer.vb file.

The Export Template Wizard cannot identify the safe name. The wizard uses the project name instead of the safe project name to search for the project name. Then, the wizard replaces the project name with the $safeprojectname$ template parameter. This behavior causes the safe project name not to be replaced. When you create a new application from the exported template, the safe project name that remains in the template causes the build errors to occur.



WORKAROUND
To work around this problem, make sure that any projects from which you export templates do not contain any space characters or invalid identifying characters in the project name.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the problem

 * 1) In Visual Studio 2005, create a new Visual Basic Windows application, and then name the project Data Project.
 * 2) Add one DataSet control to Form1.vb.
 * 3) Click File, and then click Export Template.
 * 4) Select Project Template, and then click Next.
 * 5) Type Data Project in the Template Name box, and then click Finish.
 * 6) Close the Data Project solution.
 * 7) Click File, click New, and then click Project.
 * 8) Select Data Project under My Templates, and then click OK.

When the new project loads, the project contains build errors.

For more information about the Export Template Wizard, visit the following Microsoft Developer Network Web site:

http://msdn2.microsoft.com/en-us/library/ms185318.aspx

Keywords: kbtshoot kbbug kbprogramming kbprb KB907754

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.