When building SharePoint 2010 applications using Visual Studio 2010: This shouldn’t happen at any instance, but in an unlikely event, you may end up with this error (probably when building a custom BDC .NET assembly) :
Error occurred in deployment ‘Add Solution’: The default web application could not be determined. Set the SiteUrl property in feature BdcModelProject1_Feature1 to the URL of the desired site and retry activation.
Parameter name: properties
This occurs when the feature’s manifest is missing its SiteUrl property which determines where the feature will be deployed. Here is a simple workaround:
1) Open your Feature Designer
2) Click on the Manifest tab
3) Expand Edit Options and click on Overwrite generated XML and edit manifest in the XML editor. This will allow you, the developer, to handle the manifest file instead of VS2010 handling it.
4) Add the SiteUrl property:
<Property Key=”SiteUrl” Value=”http://<your-site-name>” />
5) The final manifest will look something like this:
Now your solution will deploy fine!