BUG: You receive a "'Microsoft.VisualStudio.VCProjectEngine.VCConfiguration' does not contain a definition for 'Project'" error message when you try to build a project in Visual Studio .NET 2003 (836131)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition

SYMPTOMS

In Microsoft Visual Studio .NET 2002, you may create a project that contains a class that uses the Project property of the Microsoft.VisualStudio.VCProjectEngine.VCConfiguration class. When you try to build such a project in Microsoft Visual Studio .NET 2003, you may receive the following error message:
'Microsoft.VisualStudio.VCProjectEngine.VCConfiguration' does not contain a definition for 'Project'

CAUSE

In Visual Studio .NET 2002, the Microsoft.VisualStudio.VCProjectEngine.VCConfiguration class contains a property that is named Project. However, in Visual Studio .NET 2003, the corresponding property is named the project property (with a lowercase "p"). Therefore, because Visual Studio .NET 2003 does not contain the property that you used in your Visual Studio .NET 2002 project, the behavior that is mentioned in the "Symptoms" section of this article occurs.

RESOLUTION

To resolve this behavior, in Visual Studio .NET 2003, replace all occurrences of the incorrectly named Project property with the correctly named project property.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section of this article.

MORE INFORMATION

Steps to reproduce the problem

  1. Start Visual Studio .NET 2002.
  2. On the File menu, point to New, and then click Project. The New Project dialog box appears.
  3. Click Visual C# Projects under Project Types, and then click Windows Application under Templates.
  4. Type MyProjectTest in the Name box, and then click OK. By default, a Windows form that is named Form1 is created.
  5. On the Project menu, click Add Reference. The Add Reference dialog box appears.
  6. On the .NET tab, click Microsoft.VisualStudio.VCProjectEngine under Component Name, and then click OK.
  7. Double-click the Form1 Windows form to switch to Code view.
  8. Add the following code to the top of the Form1.cs file:
    using Microsoft.VisualStudio.VCProjectEngine;
  9. Add the following code in the Form1_Load method:
    VCConfiguration MyVariable = null;
    	  Object MyObject = MyVariable.Project;
  10. On the Build menu, click Build Solution to build the solution.
  11. Start Visual Studio .NET 2003.
  12. On the File menu, point to Open, and then click Project. The New Project dialog box appears.
  13. Locate the folder that contains the MyProjectTest solution, and then click the MyProjectTest C# Project file.
  14. In the Microsoft Development Environment dialog box, click Open, and then click Yes.
  15. On the Build menu, click Build Solution to build the solution. You receive the error message that is mentioned in the "Symptoms" section of this article.

Modification Type:MinorLast Reviewed:3/6/2006
Keywords:kbvs2005swept kbvs2005doesnotapply kbpending kbIDEProject kbProperties kbbug KB836131 kbAudDeveloper