The process cannot access the file "C: \ Inetpub \ wwwroot" because it is being used by another process

I moved my published asp.net files from

C: / xyz / mywebsite for c: / intepub / wwwroot / mywebsite. In one of the functions of the website, we create a txt file and then edit this text file in the root folder.

When I moved it to a new location, I received the error message "Unable to create file, ban refused ...". Then right-click the intepub folder and allow access to the group. Now I can create a text file in it, but I can not write it: The error I get is:

The process cannot access the file 'C:\Inetpub\wwwroot\' because it is being used by another process.

Unfortunately, I cannot make changes to the code that the website has already installed, and it will take a long time to deploy it.

All the functionality worked fine when it was in the C: / xyz / mywebsite folder.

Now, what can I do here without changing the code?

+3
source share
1 answer

First, make sure your application closes the file correctly after it is created.

If so, try disabling the indexing service. It can index a new file immediately after it is created.

+1
source

Source: https://habr.com/ru/post/1775421/


All Articles