Hi folks,
These last days I faced an error in SharePoint 2010 while I was creating BDC Model projects. At the moment of deploying my solution I got this error message in the Beta version:
Error occurred in deployment step 'Add Solution': Property 'SiteUrl' contains an invalid URL. Import failed with the following exception message: The site <site> could not be found in the Web application SPWebApplication Name=<webapplication>.
Parameter name: properties
In the RTM version the error message changed a little bit, which is still not very clear:
Error occurred in deployment step 'Add Solution': The default web application could not be determined. Set the SiteUrl property in feature <feature> to the URL of the desired site and retry activation.
Parameter name: properties
In order to solve this issue, I searched at the Internet for similar issues and I found out an excellent article of Jan Tielens that explains a workaround for that.
Just because I don’t simply like to add links to other sites with specific solutions, due to broken links, I am going to let this available here in my blog.
Getting the error message
1 – Create a new solution with a project of type Business Data Connectivity Model according Figure 1:
Figure 1 – BDCModel Project
2 – Try to deploy by Visual Studio, the error message above will show up (depending on the version).
Correcting the problem
1 – Open the Feature XML file (Figure 1) and notice there is just only one property:
Figure 2 – Original XML File
2 – Add the following element to the XML, according Figure 2:
Code Snippet
- <Property Key="SiteUrl" Value="http://localhost/sites/portal"/>
Figure 3 – Updated XML File
Note: Change the SiteUrl value to your seu web site url.
3 – Deploy successfully!
References:
http://weblogs.asp.net/jan/archive/2010/05/07/sharepoint-2010-bdc-model-deployment-issue.aspx
http://blogs.msdn.com/pandrew/archive/2010/04/08/deploying-an-external-content-type-error.aspx
Cheers,
Marcel Medina
Click here to read the same content in Portuguese.