Software engineering blog of Clément Bouillier: error MSB6006: "ResGen.exe" exited with code -532459699

Tuesday, November 30, 2010

error MSB6006: "ResGen.exe" exited with code -532459699

I write my first tip blog post to talk about the following error I got stuck one hour (far too long...) without any search results on Google:

error MSB6006: "ResGen.exe" exited with code -532459699

I got this error when compiling a project targeting 3.5 framework with VS2010, which includes some resource file with CustomAction set to generate associated code.

In fact, I was doing some change to my configuration. Long time ago, I had set up the use of DEVPATH (configure it in the machine.config on dev machine). Due to a problem explained next, I have removed the DEVPATH environement variable, but keeping machine.config as is (to avoid full reconfiguration in case I would need temporarily the DEVPATH...ok I am really lazy :)).
Then, I discover that ResGen.exe fails, I find it when I launched compilation from command line with MSBuild and it was clear in exception trace details...really bad! (note that it works when you do not have RESX files...)

By the way, you should avoid using DEVPATH. It tries to replace GAC, but in fact it fails since it does not take care of DLL versions. But do not through it away to quickly, it could be useful to debug tier DLL for example without modifying all your references...
I found it when I have to install EntLib 5.0 side to side with EntLib 4.1...then only DLL found in first path referenced in DEVPATH was taken in account.
So 2 solutions: you are not lazy and you remove configuration in machine.config OR you are lazy and you set DEVPATH environment variable to something else than empty one (for example "D:").

No comments: