Search code examples
iisiis-7asp.net-web-apiiisreset

IIS doesn't notice updated controller


On IIS 7 I have an application running which uses 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.

But when I replace one of the controllers, changes take no effect.

I restarted the IIS using the GUI, via Run | IISReset command and after this didn't work even restarted the computer. However, IIS still uses the old version of the controller.

How can I make IIS "recompile" the project and use the new controller version?

Update: Replacing the bin directory helped me out. Is there still another way to recompile directly on IIS?


Solution

  • Mvc is web application and precompile is available only on website projects

    Compilation

    Web application projects

    • 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.

    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.

    • You can precompile the site (compile in advance on a development computer or on the server). By default, compilation produces multiple assemblies.

    More info