简体   繁体   English

Web API部署错误

[英]Web API Deployment error

I get the following error when deploying my Web API Project that is targeting the .NET 4.5 Framework. 部署针对.NET 4.5 Framework的Web API项目时,出现以下错误。 I have made sure that all the referenced DLL's are in the bin folder. 我确保所有引用的DLL都在bin文件夹中。

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, ''). 解析器错误消息:Web.config文件的元素中的'targetFramework'属性仅用于目标版本4.0和更高版本的.NET Framework(例如,'')。 The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. “ targetFramework”属性当前引用的版本晚于.NET Framework的已安装版本。 Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework. 指定.NET Framework的有效目标版本,或安装所需的.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 源文件:C:\\ inetpub \\ wwwroot [网站文件夹名称] \\ web.config行:24

Version Information: Microsoft .NET Framework Version:4.0.30319; 版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET Version:4.0.30319.1 ASP.NET版本:4.0.30319.1

If i comment out line 24 and 25 i get a different error: 如果我将第24行和第25行注释掉,则会出现其他错误:

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. 解析器错误消息:无法加载文件或程序集'System.Net.Http,版本= 4.0.0.0,文化=中立,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。 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) (来自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; 版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET Version:4.0.30319.1 ASP.NET版本: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. 任何帮助将不胜感激。

Activate the feature WCF HTTP Activation for .NET 3.5 and 4.5 and try again: .NET 3.54.5激活功能WCF HTTP激活 ,然后重试:

窗户功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM