Ho creato un sito Web MVC in Visual Studio 2015 e funziona nel mio localhost. Ma quando ho pubblicato il mio sito Web e inserito nel mio host, non funziona. Mi dà questo avviso di errore:Errore di configurazione relativo a targetFramework in web.config
Server Error in '/' Application.
Configuration Error
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:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: G:\xxx\xxx.com\httpdocs\web.config Line: 24
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
parti correlate nel mio web.config:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
E questa parte con l'errore:
<system.web>
<authentication mode="None" />
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.6" />
<httpRuntime targetFramework="4.6" />
</system.web>
Proprietà del mio sito:
.210E NuGet Package Manager:
EntityFramework Riferimento Proprietà: Sito Web
default Impostazioni di base: (Per essere onesti, io non sono sicuro se devo aggiungere un nuovo sito web (il mio sito web) in qui.)
miei quadri installati .net:
il mio metodo: pubblicare
Ho studiato questo problema su Internet e ho trovato diversi link relativi al mio problema: Asp.net MCV4 framework issue. In questo link, ci sono due offerte principali:
mutevoli questo tag di compilazione
pool di applicazioni aggiornamento nel IIS
In realtà, ho cercato di cambiare questo tag, ma doesn cambiare. Quindi ho controllato il mio pool di applicazioni ma sembra aggiornato.
ho chiamato il mio fornitore ospite e ho spiegato il mio problema. Dicono che questo errore non è correlato ai loro server.
Cosa devo fare? Qual è la soluzione per questo?
Grazie in anticipo.
Is .Net Framework 4.6 installato sul server? – DavidG
@DavidG ad essere onesti, non ho chiesto questo mio fornitore host. ma in localhost .net framework 6 è installato. sto aggiungendo la sua immagine. – rockenpeace
Quindi stai dicendo che quando pubblichi sul tuo IIS locale, non funziona? O solo quando pubblichi sul tuo hosting provider? – DavidG