ASP NET MVC5编译器在IIS中发布错误(在VS2015中正常工作)

问题描述:

我正在开发一个ASP NET MVC 5应用程序。在Visual Studio 2015年工作正常,但是当我尝试发布在IIS中我得到一个错误:ASP NET MVC5编译器在IIS中发布错误(在VS2015中正常工作)

CS0103: the name 'model' does not exist in the current context. 

Línea 1: @using Name.Models 
**Línea 2: @model LoginViewModel** 

c:\windows\system32\inetsrv>"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /t:library /utf8output /R ... 

This compiler is provided as part of the Microsoft (R) .NET Framework, 
but only supports language versions up to C# 5, which is no longer the 
latest version. For compilers that support newer versions of the C# 
programming language, see http://go.microsoft.com/fwlink/?LinkID=533240 

在同一个项目中,我有没有问题,以前的出版物。

+0

你的发布包里有'System.Web.Mvc'吗? – Perdido

ASP没有登记在IIS

aspnet_regiis -i

了解更多关于它从here

+0

@David是否有效? –

我们发现了这个问题!该视图文件夹的web.config已被排除在项目之外。我们添加了它,一切都重新开始。

谢谢大家!