System.CodeDom.Compiler.GeneratedCodeAttribute error

I downloaded a sample from MSDN for VS 2005, and tried to build it (using VS2005) as described in the documentation.
I obtain 7 errors in the NorthwindCustomerOrders.XSD (NorthwindCustomerOrders.designer.vb file) saying that
Type System.CodeDom.Compiler.GeneratedCodeAttribute is not defined.

In the documentation there is a link toHOW TO: Set sample settings but unfortunately it is incomplete. It says I have to open the .Net framework SDK 2.0 command prompt but next instructions are missed.

Can you help me?
Thanks a lot

Here is the path from where I downloaded the sample:
visual studio 2005 documentation - visual studio - samples - technology samples - windows forms controls samples - datagridview control sample.

[754 byte] By [StefanoUD] at [2007-12-16]
# 1

What version of Visual Studio 2005 are you using? (look in VS Help/About for a version number like 8.0.50nnn.nn)
Can you reply with the full text of the build errors ?
You should not need to use the "HOW TO: Set Sample Settings". The sample should build and run just by pressing F5.

BenWillett at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 2
I am running into the exact same issue as Stefano. I am running version 8.0.50215.44 (beta2.050215-4400) of Visual Studio with version 2.0.50215 of the .NET Framework.

I am getting the following error: The type or namespace name 'GeneratedCodeAttribute' does not exist in the namespace 'System.CodeDom.Compiler' (are you missing an assembly reference?)

Was GeneratedCodeAttribute added after that version? Tongue Tied

CesarR at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 3
I am also running into this problem of:
Error 1 Type 'System.CodeDom.Compiler.GeneratedCodeAttribute' is not defined. C:\VisualStudio2005\DataGridView\datagridviewsample\VB\DataGridView\NorthwindCustomerOrders.Designer.vb 17 2 DataGridView

I am using beta 2 version 2.0.50215

MSDN2 doesn't appear to have anything on the GeneratedCodeAttribute or the reference needed.

Duck4565654 at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 4
I am having a similar problem, but with a windows forms application I am building. When compiling, I receive the following build error:

InternalMyTemplate.vb(line#): error BC0002: Type System.CodeDom.Compiler.GeneratedCodeAttribute' is not defined.

The system namespace is referenced correctly, but in the object browser the GeneratedCodeAttribute namespace does not exist within System.CodeDom.Compiler.

To clarify, I get this error three times on three different lines of the InternalMyTemplate.vb. Each has the same error with the only difference being the line#.

Multiple times now I have uninstalled (using the uninstall utility) visual studio team system 2005 beta 2, its assorted add-ons, and the .net framework (version 1.1 and 2). I now have visual studio and version 2 of the framework installed, no add-ons, default installs, as simple and as streamlined as I could make it. Still, I get the error.

I posted about this issue recently here.

jthomas at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 5

Hi all,

Even i faced the similar problem recently.

I uninstalled the Beta 2 version of Visual Studio 2005(carefully uninstall according to the conventions of Microsoft) http://geekswithblogs.net/cwilliams/archive/2005/04/19/36883.aspx

and then installed the
Microsoft Visual Studio 2005
Version 8.0.50727.26 (RTM.050727-2600)

Microsoft .Net Framework
Version 2.0.50727

Now its working well.

Hope this helps.

Padma at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 6

That's right.

The original problem was because the application was deveploped and tested in a machine with a diferent Framework version of the target computer.

If you compile an appplication with Framework 2.0.50727 (for example) and then you try to install and test it in a machine with previous version of Framework, you will have this error.

You ought to be careful about Framework versions in deveploed environment and target computer.

Regards

campo at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 7
I was also getting a compile error about the System.CodeDom.Compiler.GeneratedCodeAttritbute not being defined.

I had upgraded a pocketpc project from VS2003 to VS2005.

To fix it I had to remove all the references to microsoft's assemblies (system, system.data, etc) and add them again (which upgraded them from v1.1xxxxx to v2)

Its compiling fine now!!

G

Gareth_teh_Geek at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 8
Ok i also have the same issue and understand why, but is there a way around it?
cheers
Hamish_NZ at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...