JoelFan
JoelFan

Reputation: 38724

msbuild failing with "cannot find a a part of the path"

I'm running msbuild on my .sln file and I'm suddenly getting

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2291,5):
error SB3554: Cannot write to the output file "C:\Work\product\src\component\
obj\Debug\product.resources". Could not find a part of the path 'C:\Work\
product\src\component\obj\Debug\component.Resources.resources'. [C:\Work\
product\src\component\component.vbproj]

No amount of deleting binaries and retrying helps

Upvotes: 0

Views: 2407

Answers (2)

SoftwareCarpenter
SoftwareCarpenter

Reputation: 3923

The error states product.resources is failing because component.Resources.resources cannot be found.

  1. Ensure your project build order is correct since resources files are built at compile time and it cannot find the needed resources file to continue.
  2. Another solution you might try is to delete and re-add any .resx files in your projects.

Also, I would create one shared project with resources for the solution to make it easier to mange your resources. Here is an example although a little dated.

How to use shared resource file between projects in one solution?

MSDOCS-Packaging and Deploying Resources in .NET Apps

Upvotes: 1

Rob Sedgwick
Rob Sedgwick

Reputation: 4514

Had a similar intermittent problem, added these options to the copy command

Retries="10" RetryDelayMilliseconds="5000"

and it seemed to do the trick

Upvotes: 1

Related Questions