Web API Deployment error

0

I get the following error when deploying my Web API Project that is targeting the .NET 4.5 Framework. I have made sure that all the referenced DLL's are in the bin folder.

Please have a look below and see the error:

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ''). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.

Source Error:

Line 22:   </appSettings>
Line 23:   <system.web>
Line 24:     <compilation debug="true" targetFramework="4.5" />
Line 25:     <httpRuntime targetFramework="4.5" />
Line 26:     <authentication mode="None" />

Source File: C:\inetpub\wwwroot[website folder name]\web.config Line: 24

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

If i comment out line 24 and 25 i get a different error:

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Source Error:

Line 109:                <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Line 110:                <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 111:                <add assembly="*" />
Line 112:            </assemblies>
Line 113:            <buildProviders>

Source File: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config    Line: 111 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Net.Http' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

  1. Are there two related in anyway?
  2. How do i go about solving this problem?

Any help would be greatly appreciated.

c#
.net
asp.net-mvc
deployment
asp.net-web-api
asked on Stack Overflow Nov 16, 2014 by Chad • edited Jul 24, 2018 by Chad

1 Answer

-1

Activate the feature WCF HTTP Activation for .NET 3.5 and 4.5 and try again:

Window features

answered on Stack Overflow Oct 30, 2015 by BladeMaster • edited Oct 30, 2015 by Tobias Liefke

User contributions licensed under CC BY-SA 3.0