The Web Application could not be found- Error in SharePoint 2010 object model

No.of Views3678
Bookmarked0 times
Downloads 
Votes0
By  Dhananjay Kumar   On  14 Nov 2010 20:11:15
Tag : SharePoint , Setup, Upgrade, Administration and Operation
In this article, I will show to how to resolve error "The Web Application could not be found .verify that you have typed the URL correctly" in SharePoint object model. This error will occurred when you are access the Url in client .
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In this article, I will show to how to resolve error “The Web Application could not be found .verify that you have typed the URL correctly” in SharePoint object model. This error will occurred when you are access the Url in asp.net.The below exception is very frustrating when we start working with SharePoint object model.  Let us investigate how to solve below exception 

Image Loading

Above Exception can encounter in two scenarios

  1. Trying to use SharePoint 2010 object model in managed application like console or windows application.
  2. Trying to use SharePoint 2010 object model in WCF Service or Web services.

Scenario # 1: The above Exception in console or windows application

Right click on Console/Windows Application project and select properties.

Image Loading

Click on Application tab and choose the target framework to .Net Framework 3.5

Image Loading

After changing Target framework to .NET Framework 3.5, click on Build tab

Image Loading

Change the Platform target to Any CPU. Now when you run the application, you should not get the above exception.

Scenario # 2: Above Exception when using SharePoint 2010 object model in WCF

If you are getting above exception while using SharePoint object model in WCF or any Web service. You need to perform below operations
Host WCF service in IIS.  See the below link for step by step explanation on how to host WCF 4.0 Service in IIS 7.5

 http://www.codegain.com/articles/wcf/miscellaneous/how-to-create-wcf-4-0-service-and-hosting-in-iis-7-5.aspx

Only we need to make sure that, Hosted WCF service is sharing the same application pool with SharePoint. 

Image Loading

Select the Application pool to SharePoint-80.Try to apply both when you use SharePoint 2010object model. 

Conclusion

Through this article, i try to help to how to resolve In this article error  “The Web Application could not be found .verify that you have typed the URL correctly” in SharePoint object model.I hope this discussion will help you.

 
Sign Up to vote for this article
 
About Author
 
Dhananjay Kumar
Occupation-Software Engineer
Company-Infosys Technolgies,Pune
Member Type-Gold
Location-India
Joined date-20 Jul 2009
Home Page-http://dhananjaykumar.net/
Blog Page-http://dhananjaykumar.net/
Dhananjay Kumar is Microsoft MVP on connected system. He blogs at http://dhananjaykumar.net/ . You can follow him http://twitter.com/debugmode_/ and reach him at dhananjay.25july@gmail.com
 
 
Other popularSectionarticles
Comments
By:subhashDate Of Posted:11/21/2012 6:12:14 AM
issue not resolved
hi dhananjay, i m using the second scenario, i have also hosted the wcf viewing ur url mentioned in second scenario, still i get the error as the web applicaiton could not be found. Pls Help!!!!!!
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top