2012-08-27 19 views
11

Zrobiłem stronę internetową przy użyciu VS 2012 i MVC4, to działa mój localhost, ale kiedy opublikowałem i umieściłem mojego hosta, to nie działa. Konflikty IIS są takie same. Ale daje mi ten wiersz błędu:Asp.net MCV4 framework issue

To jest błąd;

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

Dziękuję za radę z góry

+1

Nie jestem ekspertem w tej sprawie, ale czy to naprawdę jest cały błąd? –

+0

Naprawiłem linie błędów. – nermik

+14

Czy program .NET 4.5 jest zainstalowany na serwerze? – jrummell

Odpowiedz

5

Musisz zaktualizować pulę aplikacji do .NET 4.0 w IIS. Prawdopodobnie obecnie jest ustawiony na 2,0.

8

miałem podobny problem z zainstalowaniem nopCommerce 2.80 na serwerze. Używam sieci IIS7. 4.0 zintegrowana pula. I właśnie zainstalowałem .net 4.5 z sekcji Produkty WebMatrix-> Frameworki. Ponowne uruchomienie będzie wymagane. Potem zaczęło działać.

12

Zmień ten tag do 4,0:

<compilation targetFramework="4.0" /> 

i usunąć ten tag:

<httpRuntime targetFramework="4.5" /> 
+0

Po prostu miałem ten sam problem i zdałem sobie sprawę, że 'httpRuntime' był kawałkiem, który blokował. –

1

wystarczy uaktualnić NET Framework do wersji 4.5 na serwerze IIS 7.5 to zrobić za pomocą Microsoft instalator sieciowy wyszukuje .NET, a następnie zainstaluje platformę .NET w wersji 4.5, a wszystkie aplikacje, które są ukierunkowane na tę wersję, będą działać

0

musisz zainstalować .NET framework 4.5, to będzie działać poprawnie. Atrybut "targetframework" nie jest rozpoznawany przez .net framework 4.0. Więc uruchom następujące polecenie w wierszu polecenia i sprawdź albo. Wersja 4.5 zainstalowana na komputerze hostingowym, czy nie. Jeśli nie, zainstaluj .NET Framework 4.5.it będzie działać poprawnie. uruchom tę komendę na cmd w następujący sposób.

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