Visual Studio Error: The “GenerateResource” task failed unexpectedly

Deadly 提交于 2019-12-05 08:10:52

I used to hit this now and again with larger solutions. My tactic was to break the larger solution down into smaller solutions.

You could also try:

http://stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx

Sounds like a bug.

http://www.codeprof.com/dev-archive/66/6-27-664019.shtm

Toward the bottom, someone suggests adding:

<GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

to your project file. Seems kind of dubious, but worth a shot.

In case someone else is looking in the future...

In my case, turned out I had a corrupted resx file.
I had increased my GDI handles and the compile error went away.

But then when I tried to run the app (with the debugger), We have a login screen that loads the main screen. The login screen called the main screen's "show" event... and the main object never got instantiated - with no error's being raised.

I reverted the resx file to a previous one and everything is fine now.

Visual Studio 2008, VB.Net, Windows 7

Can you please try adding this property under the first PropertyGroup in your project file?

<GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

Let me know if that works.

user5686483

I have already passed by this erros sometimes. All you must do is delete all files in the obj path. After that clean and rebuild your solution and it´s done.

"Clean solution" works fine. Top Menu Build ->Clean , then build, debug and publish all work fine again. Also antivirus like AVAST best disabled to publish and install trouble free. Re-enable after.

TFS likes to mark files as Read Only. delete the contents of obj/x86

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!