WSP Solution deployment - To Share or not to Share that's the question

The new support for solution deployment in WSS 3.0 is great, HOWEVER if you are deploying shared assemblies into the GAC you should be aware of the fact that WSS installs these assemblies WITHOUT trace references.

Below is a quote from Junfeng Zhang's blog.

"When you install an assembly to GAC, you have the option to specify an Assembly Trace Reference.

And we strongly recommend that you specify a trace reference, for the reason I will discuss below.

The idea behind trace reference is really simple. When multiple applications install the same assembly, and one application is uninstalled (thus uninstall the assembly it carries), other applications won't be broken."

Published Monday, September 13, 2004 12:38 AM by junfeng

 


Web Parts from Bamboo will be deployed into "bin" with custom policies, but we also put shared assemblies into the GAC just because they are shared and needs to be reference counted. We can't put them into the bin since retracting one of the solutions will break everything that is referencing the shared assembly.

Another reason for putting assemblies into the GAC is that some code MUST run with full trust so we put our gateway assemblies in the GAC too.

An example of this is if you have code that needs to use System.DirectoryServices. Your gateway assembly will demand the proper DirectoryServicesPermission permission and then assert FullTrust. We will post a detailed walk through on how to create these gatways with custom permission classes.

So if you decide to put anything into the GAC make sure it's NOT shared by anyone else since then it will break if you retract one of the solutions....
<Assembly Location="xxxxx.dll" DeploymentTarget="GlobalAssemblyCache" />


By using Reflector and looking at the FusionInstall class you can see that the assembly is added without a trace reference.

installWithoutTraceReference

I hope that MS will change this in an upcoming service pack since it really makes sharing assemblies even harder than it already is...

Some people suggest that we should have two solutions, one for the shared assemblies and one for the Web Part. The problem with this approach is that it doesn't help at all. The problem is that as more ISVs target SharePoint we will depend on the same assemblies. Retracting solution A from company B will break all solutions that share assemblies with solution A.

If anyone out there has a workaround for this "problem" please share it, we are trying to find a solution to this and if we come up with a viable solution we will share it here.

WSP solutions are great for inhouse deployments but because of the lack of trace references it fails miserably when used by commercial SharePoint vendors like Bamboo Solutions.

/Jonas


Posted Jun 23 2008, 04:19 PM by Jonas Nilsson

Comments

Claudio Brotto wrote SharePoint Solution e Shared Assemblies
on Tue, Jul 1 2008 9:13 AM

Sono capitato un po' per caso a leggere questo post su Bamboo Nations (che, devo dire, sta scalando

jritmeijer@muhimbi.com wrote re: WSP Solution deployment - To Share or not to Share that's the question
on Tue, Mar 10 2009 12:17 PM

We have exactly the same problem. Did you ever find a proper solution or do I really need to roll my own?

This is very sad and a huge oversight by Microsoft.

Jonas Nilsson wrote re: WSP Solution deployment - To Share or not to Share that's the question
on Tue, Mar 10 2009 1:04 PM

jritmeijer,

There's no solution right now, you have to either split the wsp into multiple ones or use an msi installer that has to be run on each front end...

/Jonas

jritmeijer@muhimbi.com wrote re: WSP Solution deployment - To Share or not to Share that's the question
on Wed, Jun 24 2009 9:28 AM

Hi Jonas,

Manually running an msi on each front end is a bit cumbersome and defeats the purpose of SharePoint's nice, but flawed, solution management mechanism.

Having said that, we have created a way to deal with this problem. For details see chapters 8 and 9 of our SharePoint development guidelines at www.muhimbi.com/.../muhimbis-sharepoint-development.html

Jeroen

Jonas Nilsson wrote re: WSP Solution deployment - To Share or not to Share that's the question
on Thu, Jun 25 2009 8:32 PM

Jeroen

Thanks for the post.

We have used ilmerge for some of our products. It works but it is a "workaround".

Let's hope that this flaw will be fixed in SharePoint 2010.

/Jonas

Confluence: SharePoint Development Wiki wrote SharePoint Development Weekly Roundup (25Aug)
on Tue, Aug 25 2009 10:38 AM

TOP THIS WEEK How I Benefit from Native Boot From VHD Reza Alirezaei's Blog

Add a Comment

Please sign into Bamboo Nation to leave a comment.

Blogs

    The Bamboo Team Blog
  • Home

Bamboo Nation, Media Sponsor of:

SPTechCon

Subscribe by Email

Syndication

Bamboo Nation Almost Everywhere

Follow Bamboo Nation on:Bamboo Solutions on Facebook

Bamboo Solutions on Google+

Bamboo Solutions on LinkedIn

Bamboo Solutions on Twitter

Bamboo Solutions on YouTube

Bamboo Now in Alltop!

        Featured in Alltop

SharePoint Calendars

SharePoint Calendars

Bamboo Solutions Corporation, 2002-2012