Click here to Skip to main content
15,886,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i get this error:
The type or namespace name 'HwMangementDataContext' could not be found (are you missing a using directive or an assembly reference?)

i just set the primary key of all tabel to onInsert and add this property to one column

DbType = "UniqueIdentifier NOT NULL"
Posted
Updated 31-May-12 7:27am
v2
Comments
Rajesh Kariyavula 31-May-12 5:11am    
Have you created the DataContext manually or its automatically created on providing the DataSource. And how many DataContexts you have?
parisa heidari 31-May-12 9:40am    
i create it manually an i have one datacontext.
ZurdoDev 31-May-12 13:28pm    
EDIT: removed pre tags.
Rajesh Kariyavula 31-May-12 13:38pm    
Can you share the code on how you are initializing the DataContext...And there is a problem which I have faced, even I have created DataContext Manually and when you want to update the DataContext with the DataSource then all you modifications will be reverted and will be set as per the DataSource. So my advice once you create a DataContext never update it through a DataSource, you have to do it manually.
parisa heidari 31-May-12 15:35pm    
Thank you for helping.

1 solution

If you are getting the same error after adding the reference manually, then try the below solution:

Check your build types of each project under project properties - I bet one or the other will be set to build against .NET XX - Client Profile.

With inconsistent versions, specifically with one being Client Profile and the other not, then it works at design time but fails at compile time. A real gotcha.

There is something funny going on in Visual Studio 2010 for me, which keeps setting projects seemingly randomly to Client Profile, sometimes when I create a project, and sometimes a few days later. Probably some keyboard shortcut I'm accidentally hitting.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900