I'm trying to build an ASP.NET web site for Microsoft .NET 4.0 using Entity Framework 6. The website is explicitly targetting .NET 4.0 in web.config:

<compilation debug="true" targetFramework="4.0">

, IIS Express' application pool in applicationhost.config also targets .NET 4.0:

<add name="Clr4ClassicAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />

When the site is launched, a number of CS0433 compiler errors is shown, ones like below:

error CS0433: The type "System.ComponentModel.DataAnnotations.Schema.TableAttribute" exists in both "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" and "c:\Users\%username%\AppData\Local\Temp\Temporary ASP.NET Files\vs\e798ee36\2b3f5a24\assembly\dl3\fd34a92a\0052703a_0990d101\EntityFramework.DLL"

As far as I remember, there should be no System.ComponentModel.DataAnnotations assembly in .NET 4.0. The only lead I have is the bottom line of error page, which says

Microsoft .NET Framework, version:4.0.30319; ASP.NET, version:4.6.1055.0

however, I don't know how to change specifically ASP.NET version for a website (of course, if that's the problem's source).

Related posts

Recent Viewed