2012-08-27 12 views
11

Ho creato un sito Web utilizzando VS 2012 e MVC4, è lavoro il mio localhost ma quando ho pubblicato e inserito il mio host non funziona. Le confiurazioni di IIS sono le stesse. Ma mi dà questa riga di errore:Asp.net MCV4 framework issue

Questo è un errore;

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="Forms"> 

Grazie per i vostri consigli in anticipo

+1

Non sono esperto in questo particolare argomento, ma è davvero l'intero errore? –

+0

Ho risolto le righe di errore. – nermik

+14

È installato .NET 4.5 sul tuo server? – jrummell

risposta

5

Dovete aggiornare il pool di applicazioni per NET 4.0 in IIS. È probabilmente impostato su 2.0 al momento.

8

ho avuto problema simile installazione nopCommerce 2.80 sul server. Io uso IIS7 net. 4.0 pool integrato. E appena installato .net 4.5 dalla sezione Prodotti WebMatrix-> Frameworks. Il riavvio sarà richiesto. Quindi ha iniziato a funzionare.

12

Modifica questo tag 4.0:

<compilation targetFramework="4.0" /> 

e rimuovere il tag:

<httpRuntime targetFramework="4.5" /> 
+0

Ho appena avuto lo stesso problema e mi sono reso conto che 'httpRuntime' era il blocco che stava bloccando. –

1

Hai solo bisogno di aggiornare il tuo framework .NET a ver 4.5 sul server IIS 7.5 a farlo utilizzando il programma di installazione Web di Microsoft esegue una ricerca per .NET e quindi installa la versione 4.5 di .NET framework e tutte le app destinate a tale versione funzioneranno

0

devi installare .net framework 4.5 quindi funzionerà correttamente. L'attributo "targetframework" non è riconosciuto da .net framework 4.0. Quindi, esegui il seguente comando al prompt dei comandi e controlla .net versione 4.5 in installato su computer host o non.se non installa .net framework 4.5.it funzionerà correttamente. eseguire questo comando su cmd come segue.

wmic /namespace:\\root\cimv2 path win32_product where "name like '%%.NET%%'" get version