Problem with WPF, WCF and Linq

Posted on 2009-12-27
Last Modified: 2013-11-12
   Can anyone explain me what is going on? I have a WPF screen in an assembly. This screen has this resource call:

      <McSoft_ScreenInterface_Financeiro_DRE:DefineDRE x:Key="DREDataSource" d:IsDataSource="True"/>

   DefineDRE is called in another assembly that defines the behavior class of the WPF screen and it starts like this:
  public DefineDRE()
      _dreService = new Dados.Financeiro.DRE.DREService();

   DREService is a WCF placed in another assembly and it starts with this:

   private DREEntities dre = new DREEntities();

   The problem happens in the last assembly. DREEntities starts with this:

    public DREEntities() : base("name=DREEntities", "DREEntities")

   When the base call happens an error message that soen't explains much, it just referr the WFP screen in the start of this message. The last assembly is a WCF but I don't use it like a WCF I just referr it to the main assembly which one has the WPF screen.

  The connectionStrings is placed in the first assembly and works fine if don't starts the "new DREEntities();" part of the code in the third assembly. Why is it happening? Can't I start a database connection at start time of the class?

   Using a debug in the source code of Dot.Net, the bug messages starts at line 897 of the file BamlRecordReader.cs and the code is: element = CreateInstanceFromType(elementType, typeId, false); where typeIf = elementType = {Name = "DefineDRE" FullName = "McSoft.ScreenInterface.Financeiro.DRE.DefineDRE"}

   Any hint will be helpful.

Question by:MarcoCastro
    LVL 25

    Expert Comment

    Let us first try with this. Enable tracing in your WCF to see what exactly has caused error in your service.

    To enable tracing please go to this link,

    Author Comment

    I'm not sure but in the error file seems to show no error message. I attached the log file as TXT.

    Accepted Solution

    Oh my god! The problem was: I've changed the EDMX file of folder...

    Author Comment

    If you change the EDMX of fold, change the connectionStrings like this:


    to fold DRE

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now