2012-11-24 17 views
6

Ho pubblicato un'API Web ASP.NET sul server IIS7. Quando lo sto testando localmente. Ottengo un errore di quadro di seguito:ASP.NET Web API Framework 4.5 Errore IIS7

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 <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ' <compilation targetFramework="4.0"> '). 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 20: </appSettings>
Line 21: <system.web>
Line 22: <compilation targetFramework="4.5" />
Line 23: <httpRuntime targetFramework="4.5" />
Line 24: <authentication mode="None" />

Io non sono abbastanza sicuro che cosa è sbagliato, come ho un sito web ASP.NET in esecuzione sul server utilizzando il framework 4.0.

+15

L'errore è in pianura Inglese .. è necessario installare .NET 4.5 sul server su cui è in esecuzione il sito Web. –

+0

@cloudviz Un po 'tardi, ma sentitevi liberi di accettare la risposta. È bene che le domande abbiano una risposta accettata, quindi le persone che hanno lo stesso problema non avranno bisogno di guardare i commenti. :) – Nicholas

risposta

0

Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.

È necessario installare .NET 4.5 sul server su cui è in esecuzione il sito Web.

0

Oppure è possibile modificare la struttura dell'applicazione da 4.5 a 4.0 È possibile farlo facendo clic con il pulsante destro su project >> Properties >> Target Framework.

0

scaricare .NET 4.5 da here dopo richiesta di installazione comando di marcia con successo (come amministratore) e individuare a questo indirizzo:

%windir%\Microsoft.NET\Framework\v4.0.30319

ora eseguire questo comando:

aspnet_regiis -iru