blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Keni Barwick - The Mobile Guy

rants and raves of all things Microsoft Windows Mobile - Moved to http://www.theMobileGuy.net

Sleepless nights and MSBuild Errors (aka "GenerateResource" task failed unexpectedly)

(If you want a quick fix - scroll to the bottom. Otherwise enjoy) 

After what happened with me and an MSBuild error last night I did seriously think about jacking it all in and move to Australia to become a sheep farmer...

I have been busy the last few days putting the finishing touches to an application for a client and it was all going well until I changed the capitalization of the name of the application.

When I came to build the setup project it failed... Huh? It's fine, all I have done is change a letter of it's name!

So I tried again, you know "try, try again"... Nope... Hmmm, what's the error... Unspecified! Great...

Went back to the project, ReBuild... Failed... Arrrhhh, but this time a real error...

'The "GenerateResource" task failed unexpectedly.'.....

OK, so double click the error, (I do love that little touch, thanks guys, just SO makes sence)... But O no... It's a resource error thing... No I will not jump to the line!!! :@

Press F1 that'll help... Nope. "Sometimes MSBuild has" bla bla bla.... :@ Damn it... O but at least I know it's an MSBuild issue eh!

Quick www.live.com search and BOOM a post in MSDN comes up...

Fix

So to cut along post/story short, the fix is in the Project File -

 

Open it up using your TextBased editor (Notepad will do) and place the following line:

<GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies> 

just below the  <PropertyGroup> tag, usually on the third line...

Save the file...

For good measure I'd close any instances of Visual Studio down. (you never know!)

That should do it... I've never been able to recreate it since I found it, so let's just hope we don't have it again shall we!!! 

Hope it helps...

Anyone else had issues with this? Or have you got a bug that keep'd you up until it was time for a siesta IN NEW ZEALAND!!!

Published 01 November 2006 10:45 by Keni.Barwick

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

john.rayner said:

What an obscure bug and an obscure workaround!  Was your project file upgraded from VS2003, like the people in the MSDN forum thread you linked to?

November 1, 2006 14:30
 

Keni.Barwick said:

Nope, it was a brand new Visual Studio 2005 Project. Funny eh!

But at least I have a workaround now!

November 1, 2006 14:51
 

Dave Weinstein said:

Thanks much: saved me a lot of trouble. It's funny that adding an invalid element fixes it, but glad the magic works.
May 3, 2007 04:55
 

Woody said:

Thanks for this! I still have no idea why it occurs though (Anyone ?)
May 24, 2007 14:00
 

Frank Matthiesen said:

Maaan your'e my livesaver thx from germany
June 9, 2007 21:52
 

keni barwick said:

Guess who just had this error again!!! I think it's something to do with renaming the file... I'm going to try get more info on this!
June 13, 2007 16:25
 

Detlef said:

You're my hero! Many thanks from Hamburg/Germany for your good work!
August 9, 2007 09:49
 

Graham said:

In case it happens again, far better sheepfarming in New Zealand than Australia...

February 10, 2008 20:34
 

Andy said:

I received this error when moving a visual studio project from one solution to another.  I moved 6 c# projects (all within VS 2005) -- 2 Windows apps and 4 class libraries -- and I got this error on one of the windows apps.  

I was killing myself trying to figure out WTF was wrong.  Thanks so much for this very specific fix to a very obscure problem!!

February 18, 2008 23:00
 

Emilio Pastore said:

Cheers from Sao Paulo, Brazil !

May 30, 2008 15:49

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

News

I'm an AllExpert at Allexperts.com

http://www.csthota.com/blogmap/ Subscribe in NewsGator Online
Locations of visitors to this page

Powered by Community Server (Personal Edition), by Telligent Systems