tags:

views:

21

answers:

1

I was making an edit to a long existing project. Specifically I added some fields to a table and had to delete the table from the LINQTOSQL designer and re-add it. doesn't Also had to do the same for a view. Mode some other code changes and went to build . Now my project won't build because it can't resolve any of the data context objects (all tables and views) in my code. I don't know what I did or how this happeened. I have many tables and views in the project's L2S data context so I don't wont to try and do over. Please any suggestions on how to resolve this problem are greatly appreciated. Desparate! The error messages I am getting are the familiar The type or namespace name 'equipment' could not be found (are you missing a using directive or an assembly reference?)

+1  A: 

Verify that your "entities.desinger.cs" class was auto generated if not go to the .dbml file and right click on run custom tool to generate it.

alejandrobog
I don't see that file in my project however I don't see it in an old version of the project either. I did a Run Custom Tool anyway but it did not seem to have any effect.
MikeD
Well the name may not be entities.designer.cs, that would depend on the name you give to your dbml file. In this desinger.cs file you have all the autogenerated classes for your db tables. Verify that the file contains the "equipment" class
alejandrobog
Sorry - right I do have an file with that name and it does contain the equipment class as well as all the other classes. Can't understand why my other project files can't resolve this.
MikeD
Are these classes on the same namespace that your code expect?
alejandrobog
That was it - for some reason the namespace in my designer.cs file was simply Models instead of ULS_Site.Models which had previously been. I modified the namespace line in the code and it worked. Thanks so much for your help with this. Any idea why the project name was left off my autogenerated file? Thanks again.
MikeD
The namespace for your entities can be defined on the dbml properties, maybe you change it without notice.
alejandrobog