views:

1056

answers:

2

So, I just downloaded VS 2010 Beta 2, and when I try to build one of my class libraries with several resource files, I get the error:

"The specified task executable "ResGen.exe" could not be run. The filename or extension is too long"

before that, I get the warning: Warning 4434 The command-line for the "ResGen" task is too long. Command-lines longer than 32000 characters are likely to fail. Try reducing the length of the command-line by breaking down the call to "ResGen" into multiple calls with fewer parameters per call.

Both of which, I am SURE tell me exactly what the problem is, but its not clicking with me. Since this assembly works in VSTS 2008, I am at a bit of a loss.

If necessary, I'll enter a bug with MS, but I wanted to see what the collective wisdom of stackoverflow can do for me first.

+1  A: 

I'm having the exact same problem. I've submitted the issue on the Microsoft Connect site:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=499196

Jason
Alright, so, everyone getting this bug please add your comments to this connect bug so we can get a response from MS. A workaround, or fix for Beta 2 would be awesome.
Russ
The bug is still there in the RC as well.
Marc
+1  A: 

I changed my projects to target .NET 4, and this problem went away.

Not an ideal solution though, as we're not ready to build to .NET 4 yet, but at least the product is usable.

UPDATE: Microsoft have posted an update to the connect issue:

Workarounds
1) switch to target 4.0. Obviously that isn't a workaround for a serious project, but it fixes it for experimentation.
2) I didn't try this. Go into \microsoft.common.targets and find the GenerateResource task. Make a backup of the file first. Change the Condition attribute to:
Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '%(EmbeddedResource.Identity)' != ''"

The extra clause should make resgen run separately on each input file, which will be slower, but should avoid the problem. Dan

I changed the Condition as noted, and everything is working fine so far, whilst still targeting .NET 3.5. It is noticibly slower :)

Ch00k
I mentioned that in the MS connect bug. However, it does not solve my problem though, since I can't deploy a beta product into production.
Russ
You're absolutely right, and its very annoying. It means I still work most of the day in VS2008, which is not a good way to try out new software :)
Ch00k
The work around posted works really well, I think I might switch to 2010 permanently.
Ch00k
I tried the workaround, and I am still getting the error.I'm glad it works for some people, but I still have no joy. Guess I will have to wait for RTM, and then burn a MSDN incident if it still fails to complie.
Russ
Just upgraded to the RC, and it still happens!!
Ch00k