Logo Home   Downloads   Up to Bluedog Limited
What does SP2 mean for Web Parts?
Posted on 9/12/2005 9:18 PM by Maurice Prather

Hey... what does SP2 mean for Web Parts?

Great question... The intent of today's post is to clarify the lingering questions surrounding the announcement of SP2's support for Asp.net v2.0. 

For starters, I would like to refer you to two posts by Mike Fitzmaurice.  His posts provide good detail on what to expect.

Keep Writing SharePoint Web Parts Until (at least) 2006
Web Part Interoperability -- Good News and Bad News

Now onto the lingering questions...

With WSS SP2, will the SharePoint worker process run in Asp.net v2.0?
Yes, it can.  Alternatively, you are not forced to use Asp.net v2.0.

Can I use Whidbey Web Parts on WSS SP2?
No.  Out of the box, WSS will not use any Asp.net v2.0 constructs. At the core level, SP2 will not change the rendering behavior of WSS.  In other words, WSS will not suddenly gain the ability to use master pages or Whidbey web parts. If you wish to use Asp.net v2.0 web parts in WSS SP2, you will need to build your own shim that allows the v2 web part framework to load and interact with the Whidbey Web Parts. Otherwise, you will have to wait until v3 where such behavior is the default.

What is Mike alluding to about being able to use Whidbey Web Parts in SP2?
Stay tuned!  It's all about extending the WSS platform (as noted above)...   :-)

What is the advantage of running my virtual server in Asp.net v2.0?
Once youre running in the v2.0 space, the corresponding CLR libraries are available.  Your code will be able to take advantage of new features as well as the security and performance enhancements found in the new runtime.

If my my virtual server continues to run in Asp.net v1.1, can my code call another assembly which was been compiled in .Net v2.0?
No.  CLR fundamentals state that you can't "upstream" the clr version from the current running version.  In other words, if you decide to run with v1.1, you are limited to loading/working with assemblies compiled with v1.1 or less. 

If my virtual server runs in Asp.net v2.0, will my web part code need to be recompiled?
No.  This is basically the reverse scenario of the last question; but the answer is not the same.  "Downstream" is possible; therefore, any existing 1.x compiled assemblies should continue to work.

Can I use VS2005 to compile my SharePoint v2 Web Parts?
VS2005 is bound to the 2.0 runtime; therefore, the answer is yes if you are using SP2 otherwise the answer is no.

Can I create a virtual server/directory that runs in Asp.net v2.0 and have my Asp.net v1.1 WSS site call into the pages and web services exposed by the Asp.net v2.0 site?
Yes. 

Will I need to specify assembly redirection or runtime information for my web part assemblies?
No.

Will I need to specify assembly redirection or runtime information anywhere else?
Yes.  If you wish to deploy web part packages that contain clr v2.0 compiled web part assemblies (i.e. SharePoint web parts compiled using the new clr), you will need to create a *.config file for stsadm.exe that specifies the following:

<?xml version="1.0" encoding="utf-8" ?>
<
configuration>
  <
startup>
    <
supportedRuntime version="v2.0.50727" />  <!-- update the version # once .Net v2.0 is released -->
    <
supportedRuntime version="v1.1.4322" />  <!-- this is the version number for .Net v1.1 -->
  </
startup>
</
configuration>

The config file (appropriately named stsadm.exe.config) will need to be placed next to stsadm.exe.  If you don't add the config file, you will get an error message that states "Version 1.1 is not a compatible version".

Can my SPS server run on Asp.net v2.0?
No.  See the "Bad News" section of Mike's post.

Hopefully, this will eliminate some of the confusion surrounding Web Parts (both SharePoint/v2 and Whidbey) and SP2.

-Maurice

re: What does SP2 mean for Web Parts?
Hi Maurice,
 
Thanks for the answers that were bothering me for a while. I would like if you can clarify the question:
Can I use VS2005 to compile my SharePoint v2 Web Parts?
Does this mean that I can program WSS SP2 Web Part with VS2005, use .Net 2.0 constructs and controls (like Report Viewer), compile it and run under WSS SP2?
 
Thanks.
 
Dragan
Dragan Kovacevic @ 5/22/2006 10:09 AM
re: What does SP2 mean for Web Parts?
Dragan,
 
Yes.  Keep in mind, though, once you compile in VS2005 your assemblies will be bound to the CLR2.0 runtime.  Therefore, you will only be able to run your assemblies in WSS SP2 **if** your virtual server is also using ASP.NET 2.0.  If you are using SP2 with ASP.NET 1.1, your assemblies will not load.
 
-Maurice
 
Maurice Prather @ 5/22/2006 2:27 PM
SPS and ASP.Net 2.0 virtual directory
Is it possible to use an ASP.Net 2.0 Virtual Directory on an SPS SP2 box (obviously running 1.1 on the root). Does it matter if it is IIS 5 or IIS 6?
RSexton @ 7/31/2006 11:39 AM
re: What does SP2 mean for Web Parts?

RSexton: You can definitely run an Asp.net 2.0 virtual directory along side to your v1.1 server.

Maurice Prather @ 8/2/2006 12:03 AM
re: What does SP2 mean for Web Parts?
Hi Maurice,
    I have a problem that can i use SharePoint2003 APIs in VS2005 when i try to build a WebPart?
   i have built a web user control that will use it in my webpart(it is created with VS2005), but it can't work, the SharePoint2003 APIs(as SPFolder, SPList ...... )seem don't work with VS2005.
 
Thanks in advance.
Best wishes.
Neroli.
 
Neroli @ 8/8/2006 1:26 AM
re: What does SP2 mean for Web Parts?
Neroli:
 
That should work just fine.  What type of error message have you encountered?
Maurice Prather @ 8/11/2006 1:38 AM
re: What does SP2 mean for Web Parts?
Hi Maurice,
  The project is built successfully, but can't debug and run. the error is as follow:
 
"Security Exception:
    Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
   Exception Details: System.Security.SecurityException: Failure decoding embedded permission set object.
"
 
thanks
Neroli.
Neroli @ 8/17/2006 10:34 PM
re: What does SP2 mean for Web Parts?
I just want to thank you a lot!
 
I was getting version 2.0 is not a compatible version. when having upgraded 1.1. webparts to 2.0.
 
Your blog really helped !!!
Anonymous User @ 7/17/2007 2:05 AM
Microsoft Certified Master
Are you looking for a team of SharePoint experts?
ShareSquared can help ... drop us a note.
 
 
ShareSquared, Inc.
MVP Logo
Keyword Search
 
View by category
 

Disclaimer:
The contents of this site represent thoughts and opinions of the authors , not those of anyone else - such as past, present and future employers.  This a forum of the exchange of ideas centered on SharePoint technologies.  It is not a support channel.  :)

Copyright © 2004-2009 BluedogLimited.com. All rights reserved.