none
WCF & aspNetCompatibilityEnabled="true" RRS feed

  • Question

  • Hello,

    I have a WCF project on VS2010 (framework 4.0). To be able to run it on my station I have to change the setting aspNetCompatibilityEnabled and set a "false" value

    On others stations, I don't need to put the setting to "false".

    Any idea why for this station I need to put "false" ?

    thank you very much


    Sebastien

    Friday, August 30, 2013 3:38 PM

Answers

  • http://msdn.microsoft.com/en-us/library/aa702682.aspx

    <copied>

    This value defaults to “true” if not specified. Setting this value to “false” indicates that all WCF services running in the application will not run in ASP.NET Compatibility Mode.

    <end>

    When I was needing the compatibility in a WCF ASP.NET WEB Service, it was to hold session variables on the service side. I had to put the statement in code and enable it. That was on VS2008 and framework 3.5. 

    I am using VS2010 now with 4.0 and I have no ASP.NET Compatibility in the code and having no issues. I am also running VS in "run as admin" on Vista, Win 7 and 8. 

     

    Sunday, September 1, 2013 2:12 AM
  • Hi,
    ServiceHostingEnvironment.AspNetCompatibilityEnabled Property gets a value that indicates whether this service is running in the context of the ASP.NET HTTP application pipeline.

    If ServiceHostingEnvironment.AspNetCompatibilityEnabled="false" means it not being able to access HttpContext, ASP.NET Sessions, etc. in WCF code.

    For more information, please try to refer to:
    #AspNetCompatibilityEnabled:
    http://msdn.microsoft.com/en-us/library/system.servicemodel.servicehostingenvironment.aspnetcompatibilityenabled.aspx .

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, September 2, 2013 6:00 AM
    Moderator

All replies

  • http://msdn.microsoft.com/en-us/library/aa702682.aspx

    <copied>

    This value defaults to “true” if not specified. Setting this value to “false” indicates that all WCF services running in the application will not run in ASP.NET Compatibility Mode.

    <end>

    When I was needing the compatibility in a WCF ASP.NET WEB Service, it was to hold session variables on the service side. I had to put the statement in code and enable it. That was on VS2008 and framework 3.5. 

    I am using VS2010 now with 4.0 and I have no ASP.NET Compatibility in the code and having no issues. I am also running VS in "run as admin" on Vista, Win 7 and 8. 

     

    Sunday, September 1, 2013 2:12 AM
  • Hi,
    ServiceHostingEnvironment.AspNetCompatibilityEnabled Property gets a value that indicates whether this service is running in the context of the ASP.NET HTTP application pipeline.

    If ServiceHostingEnvironment.AspNetCompatibilityEnabled="false" means it not being able to access HttpContext, ASP.NET Sessions, etc. in WCF code.

    For more information, please try to refer to:
    #AspNetCompatibilityEnabled:
    http://msdn.microsoft.com/en-us/library/system.servicemodel.servicehostingenvironment.aspnetcompatibilityenabled.aspx .

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, September 2, 2013 6:00 AM
    Moderator