I'd like to publish a webservice in visual studio 2022 over the context function "Publish..." to a remote server folder, on which internet information services (iis) is running.
If visual studio 2022 published the webservice to the remote server folder the first time, there are no errors. But when i publish the webservice a second or a third time after a few days i got the following error.
...
>*Error deleting file 'bin'. Unable to delete 'bin'. Access denied*
...
I have checked the folder and found a file 'example.dll' in the folder 'bin' from my webservice, which can not be deleted.
The not deletable file 'example.dll' is used by w3wp.exe an iis worker process.
I have to restart in iis the application pool of the webservice to unlock the file 'example.dll'.
But the problem is, that other webservice are running in the application pool and this leads to errors by the other webservices.
Is there a other way to unlock or to delete the file on publishing the webservice over visual studio 2022?