Web Reference Doesn't Include Sibling References

Last post 10-15-2009 12:29 AM by datacop. 2 replies.

Sort Posts:

  • Web Reference Doesn't Include Sibling References

    07-19-2009, 9:13 PM
    • Member
      point Member
    • sisdog
    • Member since 02-07-2009, 1:31 AM
    • Posts 12

    I have a solution that has a web project and a class project.   The class project happens to be my model and it contains and ADO.Net Entity Data Model.  Correspondingly, that class project has a reference to System.Data.Entity.  This class project is something that I'd like to reuse so I'd like it to be self contained.


    Now, when I add go into my web project and add a reference to my class project, it brings in the dll of the class project.  But, it doesn't bring in the System.Data.Entity.dll to my web project.  I have some code in my web project that reference Entity businss objects that are in my class project (like my CustomerOrder entity for example).  But, the  ADO.Net  Entity Framework has all business objects that it creates inherit from System.Data.Object.DataClasses.EntityObject.

    I get a compile error in my web project when I try to reference my CustomerOrder class because it complains that the type 'system.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced.

    So question: do I have to add System.Data.Entity as a direct reference to my web project?  Is there any way for my Solution Rebuild to copy not only my class project's dll to my web project, but also it's related dll's like System.Data.Entity so that they're there when the compile tries to compile my web project?

    Thanks for any help.

    Mark



  • Re: Web Reference Doesn't Include Sibling References

    07-22-2009, 11:37 PM
    Answer

     Hi,

    If we use Visual Studio's Add Reference from project, Visual Studio will check the assembly's metadata to search the assembly's current directory and copy referenced dll and its dependences to target Bin folder.

    Please make sure the dependenced dll also exists in the same directory with class library's dll that your web project adds reference to.

     

    Thanks.

     

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: Web Reference Doesn't Include Sibling References

    10-15-2009, 12:29 AM
    • Member
      4 point Member
    • datacop
    • Member since 05-31-2005, 2:35 PM
    • Indianapolis, IN
    • Posts 2

    Make sure you have a reference in your Web.Config..


    eg:


    <compilation debug="true">
      <assemblies>
        <!-- Snipped for Brevity -->
        <add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
      </assemblies>
    </compilation>


Page 1 of 1 (3 items)