question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not copy the file deps.json because it was not found. Microsoft.Common.CurrentVersion.targets 4919

See original GitHub issue

I updated VS 2019 to 16.9.4 version. Sometimes I am getting three errors on rebuilding solution:

Could not copy the file deps.json because it was not found. Microsoft.Common.CurrentVersion.targets 4919
Could not copy the file runtimeconfig.json because it was not found. Microsoft.Common.CurrentVersion.targets 4919 
Could not copy the file runtimeconfig.dev.json because it was not found. Microsoft.Common.CurrentVersion.targets 4919

To reprodue this issue, get this project: https://github.com/komdil/MyProject/tree/reproduceSDKIssue Rebuild twice

The project strcuture like: image

MyProject project and MyProject.Model have the same output path

I created issue on Visual Studio support: https://developercommunity.visualstudio.com/t/could-not-copy-the-file-depsjson-because-it-was-no/1400396 They mantion that it is started happening after this PR: https://github.com/dotnet/sdk/pull/14488

For workarround I removed these lines from Microsoft.NET.Sdk.targets:

    <ItemGroup Condition="'$(GenerateDependencyFile)' == 'true'">
      <AllItemsFullPathWithTargetPath Include="$(ProjectDepsFilePath)"
                                      TargetPath="$([System.IO.Path]::GetFileName($(ProjectDepsFilePath)))"
                                      CopyToOutputDirectory="PreserveNewest" />
    </ItemGroup>
    
    <ItemGroup Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'">
      <AllItemsFullPathWithTargetPath Include="$(ProjectRuntimeConfigFilePath)"
                                TargetPath="$([System.IO.Path]::GetFileName($(ProjectRuntimeConfigFilePath)))"
                                CopyToOutputDirectory="PreserveNewest" />
      <AllItemsFullPathWithTargetPath Include="$(ProjectRuntimeConfigDevFilePath)"
                                TargetPath="$([System.IO.Path]::GetFileName($(ProjectRuntimeConfigDevFilePath)))"
                                CopyToOutputDirectory="PreserveNewest" />
    </ItemGroup>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:18
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
komdilcommented, May 20, 2021

@dsplaisted Currently we have more than 30 projects in solution. Most of them have the same output and some of them not. That’s why UseCommonOutputDirectory will not help us. We cannot saparate project outputs becasue of several reasons. One of them is som,e projects output will take more than 1 gb memory. The project depedencies is complex and when I saparate output, all outputs will take more than 30gb memory. Another thing is I am running some commands in BuildEvent. This command is expecting common output. And there are many other reasons. I didn’t understand what are you mean here: If each project builds to the same output folder, then the referenced project may try to write files to the shared output folder, and then the referencing project will try to copy the file from the same source to the same destination. When trying to do a clean / rebuild, it can end up deleting a file and then trying to copy that file, resulting in the errors you are seeing. When trying rebuild it will delete file and why it will try to copy it? Maybe it should build referenced project first, and then copy?

Maybe do you need copy files in different condition (instead of HasRuntimeOutput) because it is working when I clean solution and then rebuild

3reactions
jaytoniccommented, Jan 23, 2023

We also encounter this issue on a 400+ project solution, we just cannot afford to build everything and copy everything in separate directory. This really need to be adressed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not copy the file deps.json because it was not found. ...
CurrentVersion.targets 4919 Could not copy the file runtimeconfig.dev.json because it was Microsoft.Common.CurrentVersion.targets 4919.
Read more >
Fix unable to find *.deps.json for unit tests in .NET 5
Learn about two possible solutions for the "Unable to find *.deps.json" error when trying to run unit tests for .NET 5 in Azure...
Read more >
PublishDepsFilePath behavior change - .NET
json file may not be copied to the output directory (that is, the path specified by PublishDepsFilePath ) until later in the build....
Read more >
问答- 腾讯云开发者社区-腾讯云
CurrentVersion.targets(4919, 5): [MSB3030] Could not copy the file "C:\myproject\x64\Debug\Project1.deps.json" because it was not found. Microsoft.Common.
Read more >
4.8.0-fc.6 - Release Status
Download the installer for your operating system or run oc adm release extract --tools quay.io/openshift-release-dev/ocp-release:4.8.0-fc.6-x86_64.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found