locked
Error when trying to run .NET 4.5.1 WCF service in IIS on server RRS feed

  • Question

  • User-1690212949 posted

    I'm trying to deploy a WCF service in IIS that happens to be built using .NET Framework 4.5.1.  It seems to run finally locally, but I'm getting the following message when I try to access the service URL:  

    The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.

    I thought .NET 4.5 was installed on the server, but I wanted to double check.  According to the following site:  https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx, you can check the registry and by that value, I should in fact have .NET Framework 4.5.2 installed.  However, I'm still getting the message.

    For grins, I decided to comment out the following lines in the web.config file to see what would happen:

    <compilation debug="true" targetFramework="4.5.1"/>
    <httpRuntime targetFramework="4.5.1"/>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

    Once those lines were commented out, I wasn't seeing any more errors when trying to access the service URL, though it made me doubt if .NET 4.5 was indeed installed on this particular server.

    Is there anything I need to either add to the web.config file of the service, or possibly change a setting in IIS to make sure this service utilizes ,NET Framework 4.5 on the server? 

    Monday, May 23, 2016 9:54 PM

Answers

  • User-166373564 posted

    Hi

    You could also check the .NET Framework version for an application pool, whether it uses .net 4.5.

    1. Open IIS Manager. For information about opening IIS Manager.
    2. On the Connections pane, expand the server node and click Application Pools.

    3. On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.

    4. In the Edit Application Pool dialog box, in the .NET Framework version list, select the version that you want the application pool to use or select No Managed Code if the application uses only native code.

    5. Click OK.

    Regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 24, 2016 6:41 AM

All replies

  • User-1636183269 posted

    restart your PC and try again. It looks some resource is in use.

    Tuesday, May 24, 2016 1:46 AM
  • User-166373564 posted

    Hi

    You could also check the .NET Framework version for an application pool, whether it uses .net 4.5.

    1. Open IIS Manager. For information about opening IIS Manager.
    2. On the Connections pane, expand the server node and click Application Pools.

    3. On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.

    4. In the Edit Application Pool dialog box, in the .NET Framework version list, select the version that you want the application pool to use or select No Managed Code if the application uses only native code.

    5. Click OK.

    Regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 24, 2016 6:41 AM
  • User-729036075 posted

    Well surfing in internet i found this.

    1. Open IIS Manager. For information about opening IIS Manager.
    2. On the Connections pane, expand the server node and click Application Pools.

    3. On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.

    4. In the Edit Application Pool dialog box, in the .NET Framework version list, select the version that you want the application pool to use or select No Managed Code if the application uses only native code.

    5. Click OK

    try and check if you can solve your problem

    Thursday, June 9, 2016 9:32 AM