Visual Studio 2008 comes with the WebPart project template. It’s easy now to create a webpart for SharePoint. But often we want to reuse the WePart created by others over the net. When we reuse the webpart from internet we would directly compile and start to deploy it to MOSS 2007. Sometime we might encounter "Value does not fall within the expected range" when try to deploy to the MOSS server. This error happens when an existing webpart project is reused and deployed. This error happens because there is already a package folder with the different url deployed already. Rename or delete the folder from the Project. Rebuild and deploy again it should work. Make sure you specify the URL for the project in the Project->Properties->Debug->Start Brower with URL field
Package folder
Deploy URL for WebPart