Last post Oct 09, 2013 11:34 AM by markfitzme
Oct 01, 2013 06:02 PM|mandrews1234|LINK
I had a vb.net site that was just a plain old webforms site. I wanted to migrate it into a solution and I'm running into an issue with linq.
I created a new solution and made sure it ran fine. I then copied over all of my code files. I put in my dbml file in the app_code folder and when I try to build I get this error
Error 107 Type 'System.Data.Linq.Mapping.TableAttribute' is not defined. C:\websites\WodSolution\WodSolution\App_Code\DatabaseClasses.designer.vb 1420 2 WodSolution
Any idea what that means and how to fix it?
Oct 01, 2013 06:28 PM|AidyF|LINK
Have you added a reference to System.Data.Linq in your project?
Oct 01, 2013 10:09 PM|mandrews1234|LINK
I've never had to add that to a solution before? It's always been in there for me. I'm not even sure where I'd find that. Is it just in the list of things if I go to add reference?
Oct 01, 2013 10:12 PM|mandrews1234|LINK
I just looked at the assemblies and the system.data.linq was checked. I'm pretty sure the reference is there
Oct 08, 2013 11:32 PM|Angie xu - MSFT|LINK
Error 107 Type 'System.Data.Linq.Mapping.TableAttribute' is not defined.
You could also have a look at this discussion about this issue, it gives some good hints to troubleshoot this issue, such as reference to System.Data.Linq, renaming your classes, etc.
System.Data.Linq.Mapping.DataAttribute is not defined error
hope it helps,
Oct 09, 2013 09:45 AM|mandrews1234|LINK
So the odd thing was, if I moved my dbml file outside of my app_code folder and to my site root, it works just fine.
Oct 09, 2013 11:34 AM|markfitzme|LINK
The App_Code directory is special and used primarily for website projects, not web application projects. It could very well be that including it there confused the compiler.