0

I'm getting an error, "Could not copy the file [file name in app folder] because it was not found." This is giving me a build error, not a runtime error. There is no path or file given. I am using filecopy commands, but not even on the main form. I have searched the entire solution for "FileCopy," and the only 2 are in a form not yet loaded, within a try-catch-end try. How can I find the source of this error?

12
  • Try the following: On VS menu click Tools => Options... => Projects and Solutions => Build And Run. On right side, set both MSBuild project build output verbosity and MSBuild project build log file verbosity to Diagnostic. Commented Jul 2, 2022 at 23:54
  • This was very helpful, thanks. But I'm not sure if the information it gave is anything close to a solution. the file name is C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets Commented Jul 3, 2022 at 1:38
  • 1
    The first thing to do is repair the VS2019 installation. If that doesn't help, googling for "Microsoft.Common.CurrentVersion.targets" might lead you to a solution. Commented Jul 3, 2022 at 11:40
  • I really appreciate your suggestions! Unfortunately they didn't seem to help. I did run a repair, in fact I did an update, and the error is still there. I changed the settings to Diagnostic, checked the line in the Target file (4999). This is the copy command at line 4999, in a section labeled "Copy files that have the CopyToOutputDirectory attribute set to 'Always': Commented Jul 3, 2022 at 19:32
  • 1
    @user3516774 If the build process has become corrupted, it might be less effort to copy everything to a new project than to find where it went wrong. If you were using version control (which you really should), you might be able to go back and find at what point it went wrong and investigate the changes to files which could have caused the problem. IMHO. Commented Jul 4, 2022 at 20:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.