Adsense

Friday, September 04, 2009

“Value does not fall within the expected range” when deploying WSP with VSeWSS's deploy command

I started to get a Value does not fall within the expected range error when trying to use the VSeWSS Deploy command from within Visual Studio 2008.
Error
Value does not fall within the expected range.
I spent almost an hour trying to track down what exactly was causing my problem. There are tons of posts about this error message, but it seems like there can be many causes. Unfortunately, none of these solutions worked for me.
After banging my head on my keyboard for a while longer, I started to systematically exclude elements/folders of my VSeWSS project and then trying to run the Deploy command again. Seems desperate, I know, but it ended up helping me find out what exactly was causing this error. Excluding my project Features didn’t fix the error, but by excluding the whole TEMPLATES folder the error went away. I was onto something. I started to exclude sub folders and after playing around with this for a while, I narrowed the problem down to the nav folder within my IMAGES folder. After looking in the folder, the cause was obvious… /Facepalm.
Cause
Earlier this morning I had recreated some of my navigation images and replaced the old jpgs with pngs. Unfortunately, my project was still referencing the missing files. By removing the missing references, the error went away. Too bad the error wasn’t a tad-bit more helpful instead of being completely obscure.
In conclusion. If you’re experiencing the Value does not fall within the expected range error. Double-check your VSeWSS project for any references files or folders that no longer exist or any that exist in your folders but are not referenced by your project. Remove any that you find and it might solve your problems.

1 comment:

Anonymous said...

Thx!!! I'll buy you a beer :)