-1

I am working on Web API Project in ASP.NET Core using .NET 6.0. I have also added some features of MVC to view the data. Everything was working fine. Suddenly, while modifying the project, i have tried to build the application, i have received error

Unable to copy file "D:\Soliton\Applications\MachineManagement\ServerAPI\MMAPIApp\MMAPIApp\obj\Debug\net6.0\apphost.exe" to "bin\Debug\net6.0\MMAPIApp.exe". Access to the path 'bin\Debug\net6.0\MMAPIApp.exe' is denied.

enter image description here

I have tried to give rights to everyone to the source and destination folders.

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

The path 'bin\Debug\net6.0\MMAPIApp.exe' is an executable file, and not a directory. Whatever you modified, you probably inputted the incorrect path. You probably meant bin\Debug\net6.0 as this would be a valid directory path to copy a file to.

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
  • Hi @Timothy I am doing nothing against this .exe file. I have modified HTML in view and tried to build the project. It gave me this error. Can you please further help me on it? How to get rid of this? – Akhtar Abbas Sep 07 '22 at 19:54
  • Perhaps the app is running / some process has a handle on the executable? – Yarin_007 Sep 07 '22 at 19:57
  • @AkhtarAbbas perhaps https://stackoverflow.com/questions/7130136/unable-to-copy-file-access-to-the-path-is-denied – Timothy G. Sep 07 '22 at 19:58