SharePoint 2010 BDC Model Deployment Issue: “The default web application could not be determined.”

Posted by Jan Tielens on ASP.net Weblogs See other posts from ASP.net Weblogs or by Jan Tielens
Published on Fri, 07 May 2010 09:41:00 GMT Indexed on 2010/05/07 9:59 UTC
Read the original article Hit count: 543

Filed under:

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:

  1. 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.
  2. 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).
  3. 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>
  4. 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.

© ASP.net Weblogs or respective owner

Related posts about sharepoint