首页 > 解决方案 > Visual Studio does not build with "Unable to copy file. Access denied."

问题描述

I have a project on GitHub. I cloned it in my visual studio in another pc. After hitting build it shows this error.

Unable to copy file "G:\Shikkhanobish\ShikkhanobishApp\Shikkhanobish\Shikkhanobish\bin\Debug\netstandard2.1\Shikkhanobish.dll" to "C:\Users\Microsoft\Desktop\Shikkhanobish.dll".

Access to the path 'C:\Users\Microsoft\Desktop' is denied.

I tried to change output path but didn't work. This "C:\Users\Microsoft\Desktop" is that location from where I pushed the project on GitHub. I don't know why it is copying output path.

标签: visual-studio

解决方案


如果您以管理员身份运行 IT,它应该可以工作。您可以按照以下步骤进行操作:

  • 点击开始按钮
  • 键入“Visual Studio”
  • 右键单击结果(应用程序)
  • 选择“以管理员身份运行”

PS:如果您打算在桌面上执行此操作,则路径将是:C:\Users\<YourAccount>\Desktop 而不是您在 Q 中显示的“Microsoft”。


推荐阅读