0

I have added a ADO.Net Entity Data Model in my website and named it WebSocketModel. Thus, all of its code has been generated inside the name space WebSocketModel inside the App Code folder.

But now I am unable to reference this namespace. I need to use the context classes created inside this namespace to fire LINQ queries.

I tried to reference the namespace through the using WebSocketModel; statement inside my web form but am getting the error

The type or namespace name 'WebSocketModel' could not be found 
(are you missing a using directive or an assembly reference?)

What is even more perplexing about this error is that whenever I type using intellisense automatically suggests the namespace WebSocketModel. However, later when I build my website, I get the aforementioned error.

4
  • 2
    Are your Context classes and Web Site code in different projects? if so make sure both of the target platforms are the same i.e. .Net 4. I've seen this error when one project is targeted to .Net 4 and the other to .Net 4 Client Profile. Commented Jan 31, 2013 at 7:28
  • what is the version of EF dll? Commented Jan 31, 2013 at 7:42
  • @QuintonBernhardt they are in the same project Commented Jan 31, 2013 at 8:38
  • @daryal its 1.0(1 Neutral) Commented Jan 31, 2013 at 8:46

1 Answer 1

1

OK took a long time but finally resolved this issue...I just deleted the entity model and added it again. After doing so, I got a new error:

The type 'PatientBPData' is not attributed with EdmEntityTypeAttribute but is contained in an assembly attributed with EdmSchemaAttribute. POCO entities that do not use EdmEntityTypeAttribute cannot be contained in the same assembly as non-POCO entities that use EdmEntityTypeAttribute.

And to resolve this I found this incredibly helpful

Sign up to request clarification or add additional context in comments.

1 Comment

I just had the same issue when updating from Entity Framework 4 to EF6 in VS2013. I resolved it by deleting my edmx file and recreating.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.