May 2010 - Posts

A couple of weeks ago, the Belgian Techdays were held in Antwerp. Together with Scott Hillier I presented the SharePoint pre-conference sessions (watch them online over here, search for pre-conference or SharePoint). Even though Belgium is not a very big country, the Microsoft team managed to get some high profile speakers like Anders Hejlsberg and Scott Hanselman. But if you have like 60 minutes to spare there is one session that I'd really recommend to check out, not related to SharePoint, but very interesting and entertaining nonetheless: 5 Things SQL Server does different from what many developers expect by my U2U colleague Nico Jacobs. Nico did a fantastic job, so sit back and enjoy! :-)

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.

More Posts