简体   繁体   中英

ASP NET MVC5 compiler publish error in IIS (works fine in VS2015)

I'm development an ASP NET MVC 5 app. In Visual Studio 2015 work fine, but when I try publish in IIS I obtain the next error:

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

In previous publications of the same project I had no problem.

ASP not registered in IIS

aspnet_regiis -i

Read more about it from here

We found the problem! The web.config of the Views folder had been excluded from the project. We added it and everything worked again.

Thanks everyone!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM