WCF Cache Service error

Topics: WCF Cache Service
May 1, 2012 at 6:59 AM
Edited May 1, 2012 at 7:00 AM

Hi,

I was just going through the tutorial videos and I cannot get the WCF Cache Service app to work properly. I get to the page with my username and if I click the button the following error appears in VS 2010.

 Could not find default endpoint element that references contract 'NetSqlAzManWCFCacheService.ICacheService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

  • NetSqlAzMan version (3.6.0.15)
  • NetSqlAzMan installed products (MMC SnapIn, WCF Cache Service)
  • Operating System version and installed languages: Win 7 Enterprise SP1
  • Platform (x64)
  • SQL Server version (2008 R2)
  • Coordinator
    May 1, 2012 at 9:02 AM

    HI,

    please post your app/web.config file.

    Maybe a configuration issue.


    Andrea.

    __________________________________
    Andrea Ferendeles
    NetSqlAzMan Project Coordinator
    E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

    May 1, 2012 at 9:14 AM
    Edited May 1, 2012 at 9:16 AM

    Here it is:

     

    <?xml version="1.0"?>
    
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    
    <configuration>
        <system.web>
          <identity impersonate="false"/>
          <authentication mode="Windows"></authentication>
          <authorization>
            <deny users="?"/>
            <allow users="?"/>
          </authorization>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>
    
    </configuration>
    
    

     The error occurs on this line

    using (NetSqlAzMan.NetSqlAzManWCFCacheService.CacheServiceClient csc = new NetSqlAzMan.NetSqlAzManWCFCacheService.CacheServiceClient())
                {
                    this.lblCheckAccessResult.Text =
                        csc.CheckAccessForWindowsUsersWithoutAttributesRetrieve(
                        "My Store", "My Application", "My Operation",
                        Request.LogonUserIdentity.GetUserBinarySSid(),
                        Request.LogonUserIdentity.GetGroupsBinarySSid(),
                        DateTime.Now,
                        true,
                        null).ToString();
                }
    
    Coordinator
    May 1, 2012 at 9:19 AM

    It was as I imagined ...

    It’s missing the entire section of the WCF Cache Service endpoint.

    This is a known issue in Visual Studio. NET.

    Try doing as follows:

    - Remove the service reference to WCF service Cache Service

    - Delete the file. Config

    - Remove the reference to the DLL NetSqlAzMan.DLL

    - Rebuild (do not worry about errors)

    - Add again the service reference for the WCF Cache Service

    - Add a new assembly reference to the NetSqlAzMan dll

    - Rebuild all

    Then recheck the file. Config, it should be different.

    __________________________________
    Andrea Ferendeles
    NetSqlAzMan Project Coordinator
    E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

    Da: silviudc [email removed]
    Inviato: martedì 1 maggio 2012 11:14
    A: Andrea Ferendeles
    Oggetto: Re: WCF Cache Service error [netsqlazman:354094]

    From: silviudc

    Here it is:

    <?xml version="1.0"?>
     
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
     
    <configuration>
        <system.web>
          <identity impersonate="false"/>
          <authentication mode="Windows"></authentication>
          <authorization>
            <deny users="?"/>
            <allow users="?"/>
          </authorization>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>
     
    </configuration>
     

    May 1, 2012 at 9:30 AM
    Edited May 1, 2012 at 9:34 AM

    Yes you were right.

    Re-adding the references fixed the .config file and the sample app now works.

    Thank you for the quick response.

    One extra question, if .NetSqlAzMan is to be used in an N-tier project as role based security, is it best to create a separate tier/project or simply use it whenever "check access" is required?