Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

Problem with WPF, WCF and Linq

Hi,
   
   Can anyone explain me what is going on? I have a WPF screen in an assembly. This screen has this resource call:

  <Window.Resources>
      <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")
        {
            this.OnContextCreated();
        }

   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.

  Thanks,
  Marmco
0
MarcoCastro
Asked:
MarcoCastro
  • 3
1 Solution
 
apeterCommented:
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, http://msdn.microsoft.com/en-us/library/ms733025.aspx
0
 
MarcoCastroAuthor Commented:
I'm not sure but in the error file seems to show no error message. I attached the log file as TXT.
Thanks.
McSoft.Dados.Financeiro.svclog.txt
0
 
MarcoCastroAuthor Commented:
Oh my god! The problem was: I've changed the EDMX file of folder...
0
 
MarcoCastroAuthor Commented:
If you change the EDMX of fold, change the connectionStrings like this:

root
connectionString="metadata=res://*/DREModel.csdl|res://*/DREModel.ssdl

to fold DRE
connectionString="metadata=res://*/DRE.DREModel.csdl|res://*/DRE.DREModel.ssdl
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now