Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > System.CodeDom.Compiler.GeneratedCodeAttribute error
 

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 to HOW 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.
StefanoUD  Friday, July 22, 2005 10:12 AM

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  Friday, December 16, 2005 8:53 PM

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  Monday, July 25, 2005 11:06 PM
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  Thursday, July 28, 2005 6:41 PM
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  Monday, August 08, 2005 9:55 PM
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  Wednesday, September 28, 2005 5:41 PM

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.

a Padma  Friday, October 14, 2005 12:12 PM

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  Friday, December 16, 2005 8:53 PM
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  Tuesday, April 04, 2006 1:18 PM
Ok i also have the same issue and understand why, but is there a way around it??
cheers
Hamish_NZ  Thursday, September 07, 2006 9:41 AM

You can use google to search for other answers

Custom Search

More Threads

• How TO Auto Update From mySelf TaskVisionUpdates Site?
• I don't think there is a problem with TaskVision ...
• A Bug in TaskVision ?!? ( for those puzzled about selections in DataGrid )
• Update Web Refrence Problem (Issue Vision)
• Missing ticks when in tracing mode?
• I need help with a load button
• Install TV Server into SQL Named Instance?
• Prevent keypreview on a Webbrowser Control
• Data Synchronization
• unable to install TaskVision in Windows 2000 Advance Server