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

We had an ASP.NET site that was built on .NET 2.0. It had sharepoint integration and everything was working fine until the site got migrated to .NET 4.0. I know that sharepoint is built on 3.5 framework and hence it is failing now. Are there any workarounds or any latest developments to make sharepoint work on ASP.NET 4.0 site?

share|improve this question
    
If you have something that actually requires the .Net framework 4, create a separated application, and consume SharePoint with the remote API (client object model or web services). –  Steve B Jul 10 '12 at 21:07
    
@SteveB: Did you mean to replace the current sharepoint code with client object model / webservice such that current site can be still at 4.0 version? –  NewCoder Jul 10 '12 at 21:11
1  
I mean that SharePoint can't run on .Net V4. So you can create a separate application that can query request data from SharePoint. But you have to be warned that this won't be as efficient as pure object model. –  Steve B Jul 10 '12 at 21:12
    
@SteveB is right. In fact, the comments above probably should be an answer. :) Q: SharePoint with .NET 4.0? A: Nope. –  Kit Menke Jul 10 '12 at 21:39
    
How were you exactly integrating ASP.NET application with SP? What resources were you consuming from SP? For example, were you reading documents from SP document libraries? –  Hossein Aarabi Jul 11 '12 at 2:14
add comment

1 Answer

up vote 3 down vote accepted

You have probably read .NET Framework support in SharePoint 2010 ?

Basically, it stated that SharePoint can't run on .Net V4 (I guess it's because of the workflow engine, but it's only a supposition).

If you require something that works with V4, you have to create your own application. This application can then consume data in SharePOint using remote api (Client object model or web services).

Or you can wonder what in the .Net V4 that does not exists in the V3.5 is actually required, or can't be rewritten.

share|improve this answer
    
MyCodeaspx.cs has about 4 or 5 lines of sharepoint code where it opens the sharepoint site, then list or document library and then I read content from list or document library. How can I replace these 4 or 5 lines of code with the methods you suggested. Thanks. –  NewCoder Jul 11 '12 at 13:33
    
Read this –  Steve B Jul 11 '12 at 13:34
    
I am still reading the link but wanted to know if I can use code like below in mycode.aspx.cs? using System; using System.Xml.Linq; using Microsoft.SharePoint.Client; class RetrieveListItems { static void Main() { ClientContext clientContext = new ClientContext("intranet.contoso.com"); List oList = clientContext.Web.Lists.GetByTitle("Eric"); CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = @"<View/>"; ListItemCollection listItems = oList.GetItems(camlQuery); clientContext.Load( listItems, } } –  NewCoder Jul 11 '12 at 13:48
add comment

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.