Solving the “Could not copy temporary files to the output directory” error

At times you get the error “Could not copy temporary files to the output directory” when compiling a VB.NET or C# project from inside Visual Studio. Here are some of the possible causes for this error message and the corresponding solution:

  • The target EXE or DLL file is running or is being used by another application (for example, you are using ILDASM to explore the IL code it contains. In this case the solution is quite simple: the system or the other application has locked the executable file, and you must close the running application to release this lock
  • Another VS project has a reference to the assembly you’re attempting to compile and the Copy Local property of the reference is set to False. In this case the VS project has a direct reference to your assembly (instead of creating a copy in that project’s directory) and therefore locks the file. In this case you can solve the problem by setting the Copy Local property to True (the default value). To do so, select the reference in the Solution Explorer window and then press F4 to access the Properties window, and set the Copy Local property to True.
  • Share the Post:
    Share on facebook
    Share on twitter
    Share on linkedin

    Overview

    The Latest

    microsoft careers

    Top Careers at Microsoft

    Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

    your company's audio

    4 Areas of Your Company Where Your Audio Really Matters

    Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

    chrome os developer mode

    How to Turn on Chrome OS Developer Mode

    Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS