Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Failure reading resource file
andre
#1 Posted : Friday, March 9, 2012 10:05:22 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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é
Remco
#2 Posted : Sunday, March 11, 2012 8:52:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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
andre
#3 Posted : Monday, March 12, 2012 7:13:05 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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é
Remco
#4 Posted : Monday, March 12, 2012 8:27:01 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
andre
#5 Posted : Monday, March 12, 2012 10:02:40 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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.
andre
#6 Posted : Monday, March 12, 2012 2:32:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
@Remco: You got a PM. Hope this helps!
Remco
#7 Posted : Monday, March 12, 2012 8:25:59 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks! This does definitely help a lot. Does enabling the 'Copy Referenced Assemblies To Workspace' option make any difference?
andre
#8 Posted : Tuesday, March 13, 2012 7:06:03 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
No difference.
Remco
#9 Posted : Wednesday, March 14, 2012 10:28:20 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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?
andre
#10 Posted : Thursday, March 15, 2012 4:00:11 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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.
Remco
#11 Posted : Thursday, March 15, 2012 8:59:59 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
1 user thanked Remco for this useful post.
andre on 3/16/2012(UTC)
andre
#12 Posted : Friday, March 16, 2012 7:28:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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 :)
Remco
#13 Posted : Friday, March 16, 2012 9:08:51 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Sorry, I'm just trying to understand how this worked for you ... but did the workaround work for your NCrunch build too?
andre
#14 Posted : Monday, March 19, 2012 10:44:59 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 9
Location: germany

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I used this as a pre-build script in the affected project:

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")

Then I told NCrunch to run pre-build scripts for this project.
And the NCrunch build works :)
Remco
#15 Posted : Monday, March 19, 2012 8:41:38 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Excellent thanks! Hopefully others will also find this useful :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.071 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download