You are on page 1of 4

ENABLING .NET 3.

5 IN SHAREPOINT 2007 SITES, THE LAZY WAY


You probably know that if you want to make use of the fancy new .NET stuff, like ASP.NET AJAX in SharePoint 2007 sites, you have to make a bunch of modifications in the web.config of that site. You can do that the manual way, for example Mike Ammerlaan has described how you can enable ASP.NET AJAX 1.0 in SharePoint sites already a long time ago. Recently .NET 3.5 (including a new version of ASP.NET AJAX) became available, including the steps that you needed to go through to be able to enable it in SharePoint sites. You can check out Tobias Zimmergrens post for example to get an idea. Of course the manual approaches work, but its quite a lot of XML that you have to copy-and-past into the SharePoint web.config files. If you prefer an automated way to apply those changes, you can check out the SharePoint 2007 Features project on CodePlex. Over there you can find some feature that will apply the changes for you. But before you get too excited; make sure you test those features in your farms, because Ive had some nasty experiences deploying them in SharePoint farms with multiple front-end web servers. Today Id like to introduce you the lazy way to apply the necessary changes for enabling .NET 3.5 (including the corresponding version of ASP.NET AJAX) in SharePoint 2007 sites. Actually its my lazy U2U colleague Lieven Iliano who thought me the trick, and Ive been using it ever since in my classes and demos. The trick is to slightly abuse Visual Studio 2008 (just a little bit) here are the steps:

y y

y y

y y

Start Visual Studio 2008. Create a new dummy ASP.NET Web Application Project, and make sure you target the .NET Framework 2.0 (upper right dropdown of the New Project dialog). The name of this project is not important; you wont need it anymore when were done. Copy the web.config of your SharePoint 2007 site, into the dummy Web Application project in Visual Studio. Open the Project Properties in Visual Studio (right click on the Project node in the Solution Explorer, and choose Properties; or in the Project menu, select WebApplicationX Properties). Select .NET Framework 3.5 in the Target Framework dropdown (select Yes in the confirmation dialog). Copy the web.config from the Web Application Project back to SharePoint.

Thats it; you now have copied the upgraded web.config to the SharePoint site! At this moment youre ready to make use of all the fancy new .NET 3.5 stuff in your SharePoint 2007 site. Filed under: SharePoint

http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/4be4d224-0a38-4ed395c9-d2c6bd1248d7
================================================================ Since this has been asked a million times in various forums. Here is the Final word from Michael Foertsch (secretsofsharepoint.com/cs). The SharePoint Foundation 2010 object model is not accessible using the .NET Framework 4 (or later). Calling any object or method in the object model using any framework version other than .NET 3.5 will throw the following exception: System.PlatformNotSupportedException Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime. Of course, you can always access the SharePoint objects using the web services interface from your .NET 4 application, but this will only allow limited functionality of the complete object model. ==============================================

SharePoint 2010 and .NET 4: confused?


I have seen a few queries on the Technet forums recently regarding the use of ASP.NET 4 and SharePoint, an example being this post here. There appears to be some confusion (myself included) around whether or not ASP.NET 4 is supported for both MOSS and SharePoint 2010 - in short, the answer is that it is not currently supported in either product.

Whilst it is possible to use ASP.NET 3.5 in MOSS by making some modifications to the SharePoint site web.config (instructions for doing that in MOSS here; SP2010 uses 3.5 by default), this is unfortunately not the case with version 4. The reason? ASP.NET 4 uses a new version of the Common Language Runtime (CLR). Whilst .NET 2.0, 3.0 and 3.5 all used version 2.0 of the CLR, .NET 4 uses version 4. I'm not entirely sure what happened to version 3. There is a decent post on stack overflow with further details.

For those that are wondering, the fact that .NET 3.0 and 3.5 do not show up as options within IIS is also related to the CLR version. IIS knows about that - it does not know about framework and compiler versions and the aspnet_isapi.dll from the version 2.0 is used for version 2.0 through 3.5 for this reason. Thispost explains that in more detail. Does that mean we will get a new option in IIS for .NET 4? You bet, due to the use of CLR v4.
So does that mean we are destined to use .NET 3.5 for the lifetime of SharePoint 2010? Not necessarily. Aside from the possibility of Microsoft adding support for version 4 in a future service pack, those using ASP.NET Web forms in separate virtual directories will still be able to use .NET 4 so long as said virtual directories are in a separate application pool. I have confirmed this is the case with Microsoft in this post, and believe this to be the case for SharePoint 2010. I hope that helps clarify things a little. Subscribe to the RSS feed Follow me on Twitter Follow my Networked Blog on Facebook

Features for Serminar: New in asp 4 : WF , Chart, Grid, asp ajax 4

CORE
Shrinking Session State (Gi m kch th c vng session): Nn d li u cc phin giao d ch ( M i l n 1 ip client connect t i server yu c u ph c v , th gi a c v s hnh thnh 1 session, sec ny l u gi nh ng thng tin d li u trao i gi a s v c, ty thu c vo yu c u v s l ng session, nu kh n ng l cc sec ny chi m l ng l n b nh . V th asp 4 h tr c ch compress trn session)

Expanding the Range of Allowable URLs:


Cho php nh ngh a l i di c a URL(asp c l 260) v QueryString (2048), asp 4 cho php t ng ho c gi m gi i h n ny.
<httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" />

nh ngh a nh ng k t khng h p l trn url v queryString


<httpRuntime requestPathInvalidChars="&lt;,&gt;,*,%,&amp;,:,\,?" />

Content Delivery Network Support (M ng giao d ch n i dung)


Asp 4 h tr m ng giao d ch n i dung, gip vi c truy n t i d li u nhanh ch ng, ch ng nh ng tnh tr ng qu t i server. http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-themicrosoft-ajax-cdn.aspx

Routing in Webforms ======================================

Better ViewState Control


http://www.dotnetcurry.com/ShowArticle.aspx?ID=478

ClientID in ASP 4 : support static ID


http://www.dotnetcurry.com/ShowArticle.aspx?ID=492 http://msdn.microsoft.com/en-us/vs2010trainingcourse_aspnetwebforms4_topic4

SEO Enhancements with MetaKeywords and MetaDescription


http://www.dotnetcurry.com/ShowArticle.aspx?ID=477

Warm-Up Application
http://sharepointgeorge.com/2010/warm-sharepoint-web-applications-windows-2008-r2-iis-75application-warmup-module/

You might also like