Search code examples
c#dllsdkbuild-error

Opentap Could not copy "[name].dll" to "bin\Debug\Dependencies\[Name].dll". Exceeded retry count of 10. Failed


Maybe someone of you can help me by my problem. At first to make clear this problem is a known problem on stackoverflow and I read all the solutions for that problem and tried them out but this do not solved my problem.


Problem:

MSB3027: Could not copy "C:\Users\SpecificUser.nuget\packages\opentap\9.10.4\build\payload\Dependencies\System.Runtime.InteropServices.RuntimeInformation.4.0.2.0\System.Runtime.InteropServices.RuntimeInformation.dll" to "bin\Debug\Dependencies\System.Runtime.InteropServices.RuntimeInformation.4.0.2.0\System.Runtime.InteropServices.RuntimeInformation.dll". Exceeded retry count of 10. Failed.

Due to that error I can't build my solution no matter if I build in debug mode or release mode.


Try to Solve

  1. At first I simply tried to clean the project and rebuild it
  2. I also tried to clean the solution and rebuild the solution
  3. At next I unloaded the project and reloaded it with and without dependencies
  4. Than I tried to close VS2019 and reopened the project in combination with the previous parts
  5. After that I tried to uncheck "allows NuGet to automatically check for missing packages during build in Visual Studio" (Debug -> options)
  6. Than I tried to build the project with all combinations of above
  7. Than I tried the same but with Clear All NuGet Cache(s)
  8. Than I tried to insert a prebuild action

if exist "$(TargetPath).locked" del "$(TargetPath).locked" 
if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"

This throw me an error MSB3073 but without an error message and the description says:

MSB3073: The command "if exist "C:\Users\SpecificUser\source\repos\ProjectName\bin\Debug\ProjectName.dll.locked" del "C:\Users\SpecificUser\source\repos\ProjectName\bin\Debug\ProjectName.dll.locked"

  1. Also, I made sure that the output path is clear
  2. At next I tried to delete the bin folder and the obj folder.

All tis step have no success.

Additional Problem Sometimes the dependencies would not load. For that I tried to reinstall them or reload the dependencies. Sometimes it works but usually not. Also, some References such as OpenTAP or Microsoft.CSharp has a yellow rectangular inside the symbol yellow rectangular at reference

Used Recourses

Tried Solutions from StackOverflow


Maybe someone can help me with my issue \^o^/


Solution

  • Just for everyone who is interested what is the solution.

    The problem with I hade was, that Visual Studio has problems to solve the dependencies. Due to an test I tried to recreate an project on the same path and moved the old project to my desktop. Than to look at the code I opened the old project and after that it worked.

    Solution

    Visual Studio is not able to solve the dependencies when the path is to long. Now I have changed the path and it works.