Search code examples
c#.netasp.net-mvcasp.net-corepublish

When publishing does this error "The process cannot access the file because it is being used by another process (550)" relate to files my end?


I have a C# application and am publishing from visual studio to my hosting provider, upon publishing I get the error:

Unable to add '###.dll' to the Web site.  The process cannot access the file because it is being used by another process (550).

Is this telling the files are in use my end (client side) or that the files are in use on the remote server and can't be overwritten? If I use ProcessMonitor I can't see how the DLLs is being used by anything else my end.

So if this is an issue on the server surely I can still publish my files despite them being used, it might cause a blip in use for users who are logged in but whats the alternative sit and wait for users to be logged out, then quickly publish. I'm sure I've been able to publish before when users have been logged in and using the site.


Solution

  • Rename the DLL on the server side without changing the file location in the folder structure, and move the new DLL to the same folder on the server

    That will keep the handles to the file valid and working so that existing users still will be able to access the file properly and new instances (or new handles) will go to the new DLL file you just published.