niico
niico

Reputation: 12789

Deploying ASP.net Core MVC 2 - can't overwrite mysite.dll

I have a greenfield site using ASP.net Core MVC 2.

Previously I've used MVC 5 - and when I needed to FTP up a site update I could just upload the new mysite.dll over the old one.

Now I'm unable to do this - I guess because the file was locked. The only workaround I can think of is to stop the IIS site, upload, then start it again.

How can I just FTP up new dll's like with MVC 5 sites? Why is this not possible now - when it was before? (aren't MVC 5 files also not locked?).

Or is there another quick way to do this that doesn't involve stopping the site?

I found this - no resolution yet? https://github.com/aspnet/IISIntegration/issues/226

Thanks.

Upvotes: 0

Views: 660

Answers (1)

Chris Pratt
Chris Pratt

Reputation: 239430

I'm not entirely sure, but I think the main hold up is simply in the actual design of ASP.NET Core's integration with IIS. Whereas ASP.NET sites actually run as managed code in the IIS host process, ASP.NET Core sites are run in a separate unmanaged process, and IIS serves as a reverse proxy.

The implications of this is that with ASP.NET, the actual DLLs could be essentially hot-swapped, but with an ASP.NET Core site, the app DLL itself is running wrapped in a Kestrel process. As a result, I don't see this actually changing, and it's not so much a "bug" as simply the way things work now.

That said, ASP.NET Core is a modern app framework, principally designed with modern app deployments in mind. This is something that would not be a problem at all when employing containerization, load-balancing, etc. It's in fact only a problem with filesystem deployments, which frankly are probably the worst possible way to deploy an app of all possible ways.

My suggestion: use a better deployment strategy. If that's not possible, then publish to a different directory and hot-swap the site root in IIS. If that's not possible either, then you're just going to have to stop you site first and live with it.

Upvotes: 0

Related Questions