Ok, I'm in a world of pain at the moment.
We'd been developing with VS2008 (VB.NET, mostly WinForms, also ASP.NET and Windows services) on Win7 x64, with specific requirements (that we can't get ri开发者_如何学运维d of yet), to target x86 and framework 3.5.
We recently upgraded to VS2010, and quite soon, fell foul of this ResGen.exe incompatibility issue. Basically, we can't compile the WinForms app at all with VS2010. None of the workarounds suggested by Microsoft or others have worked for either myself or the other member of my team.
So we attempted to revert to VS2008 using the technique described here (ie hack the solution file), and also by creating a brand new VS2008 solution, and adding the projects to it. This seemed fine for a short while, but now we discover that when debugging the application, unhandled exceptions are not caught in the IDE, which makes development virtually impossible.
A brand new test application created with VS2008 (compiled for x86 and .NET 3.5) does not exhibit this failure to catch exceptions.
I've had to resort to developing on VS2010 on a Win7 (32 bit) VM inside the main computer for now, and it does work... but it's slowwwwwwww!
Any ideas for a way out of this would be gratefully appreciated!!
Update:
Ok, so it's not an actual solution, but as a workaround it's not a complete disaster...
Thanks to Noah for his comment, which prompted me to explore the various virtualisation solutions around. I've now discovered (probably the last person here!) VirtualBox. Not only is it quite a bit slicker in use than VMWare Player and the various incarnations of Microsoft/Windows Virtual PC, it also has Seamless mode, where apps running on the VM appear as separate windows in the host. So I now have an x86 guest running VS2010, compiling for x86 and Framework 3.5. Since there's no x64/x86 conflict in the guest, there's no Resgen.exe problem, and my dev envt just appears as a window on my host desktop. It's still slower than running it natively would be, but I can live with it for now.
Would still appreciate any actual solutions (or, failing that, a fix from Microsoft!!)
Well I gave up.
VirtualBox was Ok for a while, but the slowness of the VM was annoying, and forever having to manage moving stuff between the host and guest was driving me crazy.
So I've rebuilt the whole machine with Windows 7 x86.
Completely disgusted with Microsoft's apparent indifference to the problem, but I guess I'm not the first to feel that.
You can just make Make ResGen.exe 32-bit by: 1. Cd “%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\Bin” 2. Corflags /32Bit+ /Force ResGen.exe
Save your previous resgen.exe before this change.
After this change you would need to modify all of your projects to tell Resgen to run in 32bitmanaged mode
Adding Managed32Bit to a PropertyGroup in the project file of any project that generates resources targeting .NET 3.5 – since the corflags trick affects the bitness of ResGen.exe on a system-wide level, the property must be set for all affected projects as well.
OR If running MSBuild.exe directly, passing it using the global property switch: ‘/p:ResGenToolArchitecture=Managed32Bit’
The solution is posted at http://tune-up-pc.com/blog/?p=10790
精彩评论