bippan
bippan

Reputation: 289

Not able to copy file in .Net application

I am trying to add authentication for .Net core web app, but when I try to run the code it is unable to copy some files even though I have full access to the system.

I following this doc for web app authentication link

Error that I am receiving is

Error   MSB3027 Could not copy "C:\Users\userName\.nuget\packages\system.security.cryptography.protecteddata\4.5.0\
runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll" to 
"bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll". 
Exceeded retry count of 10. Failed.
WebApp-OpenIDConnect-DotNet C:\Program Files (x86)\Microsoft Visual Studio
\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 4364    

Upvotes: 2

Views: 3006

Answers (2)

Ali A. Dabwan
Ali A. Dabwan

Reputation: 11

you have to move the folder of project to shorter path , it solved

Upvotes: 1

Jamshaid K.
Jamshaid K.

Reputation: 4567

I had the same problem with exact same dll file. Unlike Tisa suggested to put the dll to a shorter path, my project was getting the dll file from .nuget folder from my user folder like: C:\Users\nameofuser\.nuget\...path... which I knew, I shouldn't modify plus I had no idea after modification where should I reference it.

So, for publishing, I moved my project to a shorter path location such as from C:\Users\nameofuser\Documents\Visual Studio 2019\repo\Github\projectfolder to C:\Users\nameofuser\Desktop\projectfolder and it worked fine. Make sure to grant relevant file permissions to Visual Studio after copying/moving the project to a different location.

Upvotes: 4

Related Questions