This is an issue with vs.net. There is a hotfix for this available from MS to solve this, the KB number is: 887818 . You can call Microsoft's PSS to achieve this fix.
See: http://support.microsoft.com/default.aspx?scid=kb;en-us;887818
I'm not allowed (by microsoft) to distribute this fix myself, although the fix is from October 16th, 2004 !!
.
Though, you can work around it by either doing:
1) place your generated code in a separate solution, compile the two assemblies, then in your actual project solution, reference the assemblies
OR
2) place all projects in a single solution, set all copy locals to false for ormsupportclasses and manually copy the files to the bin folder
OR
3) as 2 but place the ORM support classes in the GAC manually. Be aware that when you install an update, you have to manually update these files.
Trust me, I'm fed up with this bug in vs.net even more than you are and it truly sucks that I have the fix right here but can't give it to my customers. I've contacted Microsoft about their stupid Hotfix policy a dozen times already, last time this morning. Everytime they start by listening and offering better times but these never come.
I've asked my MVP lead to distribute my rant on this (http://weblogs.asp.net/fbouma/archive/2005/07/13/419205.aspx) to the person inside MS so it perhaps gets somewhere. If I get the green light to distribute this hotfix I'll mention it here of course.