SharePoint 2010 BDC Model Deployment Issue: “The default web application could not be determined.”
Yesterday I tried to deploy a Business Data Connectivity Model project created in Visual Studio 2010 to my SharePoint 2010 test server (all RTM versions), but during the deployment of the solution, SharePoint threw my following error:
Add Solution:
Adding solution 'BCSDemo2.wsp'...
Deploying solution 'BCSDemo2.wsp'...
Error occurred in deployment step 'Add Solution': The default web application could not be determined. Set the SiteUrl property in feature BCSDemo2_Feature1 to the URL of the desired site and retry activation.
Parameter name: properties
A little bit of searching on the internet taught me that I was not the only one having this issue, actually Paul Andrew describes how to solve it in this post. Although Paul describes what to do, his explanation is not, let’s say, very elaborate. :-) So let’s describe the steps a little bit more in detail:
- Create a new Business Data Connectivity Model project in Visual Studio 2010 and (optionally) implement all your code, change the model etc. When you try to deploy you get the error mentioned above.
- To fix it, in the Solution Explorer, navigate to and open the Feature1.Template.xml file (the name could be different if you decided to give your feature a different name of course).
- Add the following XML in the Feature element that’s already there (replace the Value with the URL of your site of course):
<Properties>
<Property Key='SiteUrl' Value='http://spf.u2ucourse.com'/>
</Properties>
The resulting XML should look like:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
<Properties>
<Property Key='SiteUrl' Value='http://spf.u2ucourse.com'/>
</Properties>
</Feature> - Deploy the solution, now without any issues. :-)
What happens now, is that when Visual Studio creates the SharePoint Solution (the WSP file), it will use the Feature template XML to generate the Feature manifest, which will now include the missing property.