Build/Test Issues

Failure reading resource file

Started by andre on 14,372 views

Hi!
I'm having problems compile one project in my solution:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Workflow.Targets (121): Fehler beim Lesen der Ressourcendatei "c:\NCrunchWorkspace\4808\292\xyz\obj\Debug\abc.obj.Debug.abc.g.resources.resources" -- "Das System kann die angegebene Datei nicht finden. "

The system cannot find the file.
A file named "abc.g.resources" is available in the specified directory.

Edit: Building in VS 2010 is no problem.
I'm using NCrunch 1.38.17.

Thanks in advance.
André

Edited

Hi, thanks for posting!

It looks like NCrunch is neglecting to copy one of your resource files into the workspace while building your project.

Most likely you can solve this problem by ensuring the problematic file is included in the workspace. You can do this by adding the file to your 'Additional files to include' list (under your project configuration).

Would you be able to show me the syntax in your .proj file used to link the resource file into the project? I can then adjust NCrunch to automatically configure itself for these files in future.


Cheers,

Remco
Hi!
My problem is that I cannot identify which resource is not included.
In the compile error, "abc" is the name of the assembly which fails to build.
André
In the Tests Window, there's an option to browse to the NCrunch workspace for project by right clicking on the failing project and looking under the Advanced menu.

Probably what I would suggest would be to compare the contents of this workspace with the project directory that houses your project within the solution. Check for differences - particularly around resource files. A directory comparison tool may also help with this. If you find any resource related files that are in your original project directory but not in the NCrunch workspace, try including them with the 'Additional files to include' setting and see if this helps.
I compared the folders with WinMerge and added ten folders (**.*) which were not included in the NCrunch Workspace to the "Additional files..." list.
Now the only differences are in bin and obj folders.
But it still doesn't work. The same error occurs.
@Remco: You got a PM. Hope this helps!
Thanks! This does definitely help a lot. Does enabling the 'Copy Referenced Assemblies To Workspace' option make any difference?
No difference.
Looking at the information you've sent through, I've been able to reproduce this problem by creating a workflow project and adding a WPF page to it. It looks as though this is caused by some kind of compatibility clash between WWF and WPF build steps.

However, my reproduction of this issue seems to occur for normal builds as well as NCrunch builds. Did you come across this problem yourself with your project? Have you implemented a workaround of some kind that is failing for NCrunch builds?
I checked the pre/post event builds, solution file, etc. and cannot find something special.
Can you send me your test project? I also created an WF project with an WPF Control an it's compiling fine.
Sure - I've uploaded it to http://files.ncrunch.net/Workflow.zip.

Admittedly I had to follow a guide to actually build this project, as I think I might be missing a template in my VS setup. The workflow templates that seem to be installed in the version of VS that I'm using don't have any references to the Workflow.targets file, which seems to be the source of the problem you've described. Are you able to give me any more information about which template you used to set up your workflow project? Sorry that my workflow knowledge isn't good - I haven't myself used it before.
Thank you for figuring this out.
I used a workaround described here.
Not the best solution, but it works.
I inherited this project a few weeks ago, so I can't tell you which template was used.
Finally I now live with this workaround and successive migrate the WPF parts to another project.

Thanks again :)
Sorry, I'm just trying to understand how this worked for you ... but did the workaround work for your NCrunch build too?
I used this as a pre-build script in the affected project:

[h]IF EXIST "$(ProjectDir)obj\$(ConfigurationName)\$(TargetName).g.resources" (copy /-Y "$(ProjectDir)obj\$(ConfigurationName)\$(TargetName).g.resources" "$(ProjectDir)obj\$(ConfigurationName)\$(TargetName).obj.$(ConfigurationName).$(TargetName).g.resources.resources") ELSE (echo "placeholder" > "$(ProjectDir)obj\$(ConfigurationName)\$(TargetName).obj.$(ConfigurationName).$(TargetName).g.resources.resources")[/h]

Then I told NCrunch to run pre-build scripts for this project.
And the NCrunch build works :)
Excellent thanks! Hopefully others will also find this useful :)

Post a reply

Log in to reply.