Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Working with the VS 2008 extensions for WSS for a week now (on 32-bit..sigh) and today i got an odd behavior from it, which seems to be the same as was occuring for VS 2005 extensions for WSS..methinks this might just be a straight port.

anyways, been deploying web parts from VS as i've been developing them (and for testing of course) quite happily since i installed them. But today i started getting an ambigious error "Value does not fall within the expected range" showing in the VS IDE error list. double-clicking on it solved nothing..

Tried a few things to see what was caushing this and ReSharper's inbuilt solution analysation tool showed nothing either...odd.

then went through the build output and saw that the error occured straight after "Creating Solution...". With no stack and no indication on what was causing it.

Very useful error? not really...strange thing was that the solution would build, my pre-build and post-build events were firing fine..everything was working, except deploying the web parts.

Tried pulling one after the other out of the project..nothing..nada..was...not..working.

Lastly i tried, just for fun really, to move to the solution folder and "remove" the pkg folder (the package folder that is, but it's called pkg), did another deploy and voila..working.

So, if you get this ambigious error simply just remove that folder. it'll be generated again and i'm assuming that there's either a permission issue popping up there or a corruption of the files. Regardless, deleting that folder did the trick.

Update: it appears that i now have to delete the "pkg" folder each time i want to deploy....hmmmmm. think this might have to be brought to the teams attention as i've seen this problem mentioned for VS 2005 VSeWSS 1.1 as well.

Update: an easy fix for this problem is to add a pre-build event rd /S/Q "$(ProjectDir)pkg\" which will remove that folder and all files in it before attempting to build the project. It doesn't really fix the problem (as i don't know what's causing it to start with) but it does allow you to continue on with your work if you get stuck with this. Still looking for a "TRUE" solution to stop it altogether.

Published Thu, Jul 10 2008 9:14 by Brian Madsen

Comments

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Monday, September 29, 2008 2:23 PM by Jason

Have you found a more permanent fix for this issue.  I am having the same problem, however, I cannot blow away the pkg directory every time because that deletes any customization of the wsp that I have done (like combine features or add feature receivers).

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Monday, September 29, 2008 8:14 PM by Brian Madsen

Jason,

As i understand it, the PKG folder is generated each time you do a deployment - delete it and it'll remake it on deployment. Modify files in there and they'll get swapped back.

I might be wrong here, but wouldn't it be better to write a custom solution which generates your customisations rather than use the files in the PKG folder?

Anyways, no, haven't found a permanent fix to this - still looking as i'm doing more and more work down this avenue these days.

Will definitely blog a solution once i find one.

# Value does not fall within the expected range - sharepoint webpart deployment error

Thursday, October 30, 2008 9:37 AM by Adrians Development Blog

<p>If you receive this error when deploying a sharepoint webpart using the VS2008 extensions - try this fix..</p> ...

# Value does not fall within the expected range - sharepoint webpart deployment error

Thursday, October 30, 2008 9:38 AM by Adrians Development Blog

<p>If you receive this error when deploying a sharepoint webpart using the VS2008 extensions - try this fix..</p> ...

# VSeWSS 1.3 Soloutions to Source Control richard-slater.co.uk

Thursday, February 05, 2009 4:35 AM by VSeWSS 1.3 Soloutions to Source Control richard-slater.co.uk

Pingback from  VSeWSS 1.3 Soloutions to Source Control richard-slater.co.uk

# Value does not fall within the expected range at Superdopey&#8217;s Techblog

Pingback from  Value does not fall within the expected range at  Superdopey’s Techblog

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Thursday, February 12, 2009 7:26 AM by Ralph de Ruijter

Excellent post I had the same experience but your solution helped!

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Tuesday, April 28, 2009 3:46 AM by C.A.L.M

thanks

it works fine

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Monday, May 04, 2009 12:45 PM by Sharepoint Dev

 I'm getting this error after the first successful deploy but I cannot find a folder named pkg even after searching the entire drive for 'pkg'.

 Where is this folder or is there an alternate solution?

Thanks for your help

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Tuesday, May 05, 2009 10:02 AM by Brian Madsen

@SharePoint Dev,

The "pkg" folder should be sitting just below your project directory. If you click on "Show all files" in the Solution Explorer (second icon from the left at the top of that pane) it'll hopefully show up.

That being said - try having a look at the April CTP for ver. 1.3 of the VSE..I haven't had that behavior happen, even on the same machine, as 1.2 showed.

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Monday, May 11, 2009 1:57 AM by urenjoy

Great Job Man!!!

It helped me.

I think it is bug for VSeWSS.

# re: Error on subsequent deployment of web part for VS2008 and VSeWSS 1.2

Thursday, May 14, 2009 9:02 AM by AnSPSDev

Tks a ton ... Ur post helped me .. i was just trying out with VSEWSS 1.3...