locked
Unable to call WCF service which uses Enterprise Library Data Application Block RRS feed

  • Question

  • Hi,

     

    I have built one WCF service using VS2005 which have 'WCF Extension for VS2005' installed.

     

    I am using Enterprise Library - Data Access Application Block  (Jan 2006) in WCF service for database interaction. I am giving reference to data, common and objectbuilder dlls.

     

    Now while calling the service from client (one console application which have proxy class generated using SvcUtil.exe tool) it gives me runtime error :

     

    "Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified"

     

    However when I use SqlHelper instead of Enterprise library the code works fine.

     

    I have tried both wsHttpBinding and basicHttpBinding but face the same error.

     

    Thanks in advance.

     

    Deepak Gahlot

    Monday, August 27, 2007 11:50 AM

Answers

  • Hi,

     

    The problem is solved now Smile

     

    Problem :

     

    I was hosting the WCF service to wwwroot and copying the service dll from application directory/bin to wwwroot through post-build event command, however I forget to add the enterprise library dlls in the post-build event command.

     

    Enterprise Library dlls are also not present in GAC unless added explicitly, so while client was calling the service it was throwing that error.

     

    Solution :

     

    I have added these dlls too in post-build command and it is working fine now.

     

    Note : SqlHelper was working fine because the code file (SqlHelper.cs) was added to the project so there was no separate dll created for that.   

     

    Regards,

    Deepak Gahlot

     

    Wednesday, August 29, 2007 12:52 PM

All replies

  • Hi,

     

    The problem is solved now Smile

     

    Problem :

     

    I was hosting the WCF service to wwwroot and copying the service dll from application directory/bin to wwwroot through post-build event command, however I forget to add the enterprise library dlls in the post-build event command.

     

    Enterprise Library dlls are also not present in GAC unless added explicitly, so while client was calling the service it was throwing that error.

     

    Solution :

     

    I have added these dlls too in post-build command and it is working fine now.

     

    Note : SqlHelper was working fine because the code file (SqlHelper.cs) was added to the project so there was no separate dll created for that.   

     

    Regards,

    Deepak Gahlot

     

    Wednesday, August 29, 2007 12:52 PM
  • How to set database application role to the enterprise library?
    Wednesday, November 14, 2007 8:52 PM