简体   繁体   English

IIS不会注意到更新的控制器

[英]IIS doesn't notice updated controller

On IIS 7 I have an application running which uses Entity Framework Web API. 在IIS 7上,我正在运行一个使用Entity Framework Web API的应用程序。 When I copy and replace one of the .cshtml (HTML and JS) files in the Views folder, the change is applied instantly. 当我复制并替换Views文件夹中的.cshtml (HTML和JS)文件之一时,更改将立即应用。

But when I replace one of the controllers, changes take no effect. 但是,当我更换其中一个控制器时,更改无效。

I restarted the IIS using the GUI, via Run | IISReset 我通过Run | IISReset使用GUI重新启动了IIS Run | IISReset Run | IISReset command and after this didn't work even restarted the computer. Run | IISReset命令,此后甚至无法重启计算机。 However, IIS still uses the old version of the controller. 但是,IIS仍使用旧版本的控制器。

How can I make IIS "recompile" the project and use the new controller version? 如何使IIS“重新编译”项目并使用新的控制器版本?

Update : Replacing the bin directory helped me out. 更新 :替换bin目录帮助了我。 Is there still another way to recompile directly on IIS? 还有另一种直接在IIS上重新编译的方法吗?

Mvc is web application and precompile is available only on website projects Mvc是Web应用程序,预编译仅在网站项目上可用

Compilation 汇编

Web application projects Web应用程序项目

  • You explicitly compile the source code on the computer that is used for development or source control. 您在用于开发或源代码控制的计算机上显式编译源代码。
  • By default, compilation of code files (excluding .aspx and .ascx files) produces a single assembly. 默认情况下,编译代码文件(不包括.aspx和.ascx文件)会生成单个程序集。

Web site projects 网站项目

  • The source code is typically compiled dynamically (automatically) by ASP.NET on the server the first time a request is received after the site has been installed or updated. 通常,在站点已安装或更新后,第一次接收到请求时,ASP.NET会在服务器上通过ASP.NET动态(自动)编译源代码。

  • You can precompile the site (compile in advance on a development computer or on the server). 您可以预编译站点(预先在开发计算机或服务器上进行编译)。 By default, compilation produces multiple assemblies. 默认情况下,编译会产生多个程序集。

More info 更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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