Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a Silverlight 4 Beta application where I'd like to use the SharePoint object model to upload a document to a SharePoint site - should be simple enough, except an exception is thrown at:

using (SPSite siteCollection = new SPSite(siteCollectionUrl))

The Web application at http://intranet.fabrikam.com could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

This particular exception is actually really well documented out there, it's obviously masking a real underlying issue. Here are some of the things I've read about and tried without success:

DNS / Host Header: This exception occurs when the particular URL isn't in the IIS metabase because it's being handled by DNS. My web application has an AAM set up and a host header on the web site in IIS. I also tried running the code without using the FQDN of the site, e.g. http: //servername:4860.

Permissions: The identity of the the Silverlight application pool has db_owner permissions to my content database, and is also a site collection administrator. I can't have both web sites use the same application pool because the Silverlight application needs to run in a .NET app pool.

x86 vs x64: My Silverlight application has to be compiled for x86 - I'm using some controls that only work in x86. The installed SharePoint version is x64. I've read about people seeing this exception when trying to use the SharePoint object model to hit a x64 SharePoint installation from a x86 app.

Adding then removing permissions for the account: This begins to border on some voodoo magic, but I read about people magically resolving this issue after removing the permissions they set trying to troubleshoot this problem initially. No luck here.

Would appreciate any suggestions, thank you!

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You cannot/should not use the standard SharePoint object model/API's when creating applications that does not run on the actual SharePoint servers. Here is a list of the Web Services in WSS 3.0

You need to use the web services to interact with SharePoint, or if you are using SharePoint 2010 then use the Client Object Model. Read this overview of the Client Object Model if you are interested

share|improve this answer

Here is introduction post on Silverlight Client Object Model in SharePoint 2010. This will also helps the devs to understand and create applications. Take a look at it.

http://praveenbattula.blogspot.com/2010/03/sharepoint-2010-silverlight-client.html

All SharePoint 2010 articles here: http://praveenbattula.blogspot.com/search/label/SharePoint%202010

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.