problem with assembly signing and strong names


A

Andy Fish

Hi,

I have an application which consists of a handful of DLLs referencing
each other, and does not use assembly signing. This allows us to make
a minor patch to one assembly without up-versioning and re-releasing
all other assemblies that depend on it, and this has been useful for
us in the past.

We have recently done some integration with SharePoint which involved
web parts. one of our assemblies contains some useful constants and we
wanted to reference it from the web part. Any assembly referenced from
a web part must be signed with a strong name and put in the GAC.

Signing one assembly means that all other assemblies that reference it
automatically have a strong reference to it. So even though 99% of my
customers don't have sharepoint, integrating with sharepoint means I
must use strong references throughout my projects.

Ideally I would like to keep the "constants" assembly strongly named
(to be compatible with Sharepoint) but, when I reference it in other
contexts, to reference it in a non-strongly-named way, in other words,
to say "although this assembly is signed, reference it although it
wasn't" Is there any way to achieve this?

My other idea is to take a separate copy of the assembly and sign it
for use by sharepoint, then use the non-signed version whenever i'm
referencing it out of sharepoint. However, this makes the build more
complex and creates a problem of having 2 different builds of the same
assembly.

Any thoughts would be most appreciated.

Andy
 
Ad

Advertisements

J

James VanDyne

My first thought is to modify your project file to handle the strong naming
for you. Create a special build event that handles the strong naming of
your assemblies. So your build configuration would have something along the
lines of Debug, Release, ReleaseToSharePoint. The release to SharePoint
configuration would handle your strong naming (obviously).

http://msdn.microsoft.com/en-us/library/e85wte0k(VS.80).aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top