How to not get the error "ERROR_FILE_IN_USE" when deploying an ASP.NET Core website using FTP / public folder?

I have an ASP.NET Core RTM web application that targets .net framework 4.52

In my project.json

 "frameworks": { "net452": {} }, 

When I publish it in a folder, it creates MyWebApplication.exe , and when I access the application in my browser, exe starts.

I need to publish a website on a web server with Windows Server 2012 and IIS8

I have access to shared folders via VPN in the website deployment directory.

The first time I publish a site in a folder, it worked correctly. I am accessing the website url and site. However, when I want to republish the website after making the changes and copying the files, it tells me that MyWebApplication.exe is MyWebApplication.exe used and the publication fails.

The only way I know how to solve this is before publishing, to kill MyWebApplication.exe in the task manager on the web server. However, since I only have access to this server through a shared directory, this is not possible.

With ASP.NET 4 websites, I don't have this problem.

With ASP.NET CORE RC1 I also did not have a problem since it used dnx , although HTTPPlatformHandler , which allowed me to copy the site without having to kill dnx.exe . I just had to touch web.config and the site will restart.

My questions:

  • Is there a way to copy / publish a new modified version of a site that has already been deployed (either FTP, or through access to shared folders)?

  • Is there any way to stop the site, for example. to unload MyWebApplication.exe from memory on a web server either via FTP or through shared folder access?

+6
source share
2 answers

ERROR_FILE_IN_USE error is an open problem on github

Just remove the web.config publishing directory before publishing.

Without web.config, the site will automatically stop and unload files from memory and will not allow anyone to load the site into memory again by accessing the URL.

Another workaround is to copy app_offline.htm to the publication directory, which should also work. Link

+3
source

I solved this problem by stopping my web application on the hosting. After everything has been successfully published.

+1
source

All Articles