asp.netwindowsvisual-studio.net-coremsbuild

Error MSB3030 Could not copy the file "C:\Users\...\WebApi3\obj\Debug\netcoreapp3.0\webapi3.exe" because it was not found


Hi Stackoverflow Community,

I am trying to build my Web and WebAPI, console applications with Target Framework - .NET Core 3.0, as per project 'Application' properties, using:

Microsoft Visual Studio Community 2019 Version 16.5.4 on Windows 10 PRO

I am seeing the following errors:

Error MSB3030 Could not copy the file "C:\Users...\WebApi3\obj\Debug\netcoreapp3.0\webapi3.exe" because it was not found

and

Error MSB3030 Could not copy the file "C:\Users...\Web\obj\Debug\netcoreapp3.0\webportal.exe" because it was not found

Hence these projects are not getting built.

Appreciate your time for reading this.

Please advise.

Here is the part of the code where the error points to:

    ============================================================
                                        _CopyOutOfDateSourceItemsToOutputDirectory

    Copy files that have the CopyToOutputDirectory attribute set to 'PreserveNewest'.
    ============================================================
    -->
  <Target
      Name="_CopyOutOfDateSourceItemsToOutputDirectory"
      Condition=" '@(_SourceItemsToCopyToOutputDirectory)' != '' "
      Inputs="@(_SourceItemsToCopyToOutputDirectory)"
      Outputs="@(_SourceItemsToCopyToOutputDirectory->'$(OutDir)%(TargetPath)')">

    <!--
        Not using SkipUnchangedFiles="true" because the application may want to change
        one of these files and not have an incremental build replace it.
        -->
    <Copy
        SourceFiles = "@(_SourceItemsToCopyToOutputDirectory)"
        DestinationFiles = "@(_SourceItemsToCopyToOutputDirectory->'$(OutDir)%(TargetPath)')"
        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
        Retries="$(CopyRetryCount)"
        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
        UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
            >

      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>

    </Copy>

  </Target>


Solution

  • Updating Visual Studio to 16.5.5. seems to have solved the issue so far.