Home Blog .NET C:windowssystem32configsystemprofiledesktop is unavailable
C:\windows\system32\config\systemprofile\desktop is unavailable
.NET
Written by Dicky   
Tuesday, 10 April 2018 09:43
AddThis Social Bookmark Button

I was working on this .NET Core application and when I try to run the debugger, it gave me the following error:

C:\windows\system32\config\systemprofile\desktop is unavailable

on this particular section of the code in Program.cs

var host = new WebHostBuilder()
 .UseKestrel()
 .UseContentRoot(Directory.GetCurrentDirectory())
 .UseIISIntegration()
 .UseStartup<Startup>()
 .Build();

I tried to go to that directory and it gave me a pop-up requesting for administrator permission. After that, I re-opened my Visual Studio 2017 with Administrator permission i.e., search for Visual Studio - right click and select Run as administrator and voila, I was able to debug my code using Visual Studio.