views:

97

answers:

2

So here's the problem. I'm writing some StyleCop plug-in assemblies for use at the company I work for. As such, these assemblies need to reference Microsoft.StyleCop.CSharp.dll for example, which is strongly named.

The problem comes in that if I build this and pass it along to the developers in my group, they must have the same version of the StyleCop dll (currently 4.3.3.0) or it fails to load.

What is the best way to make my add-on rules DLL more independent? Should I just install my 4.3.3.0 version of those subordinate StyleCop dlls in the GAC? Can an assembly (vs an application) use a policy file?

Oh, and one of the main problems is i would like it to work with ANY version of StyleCop the client has installed (or at least 4.3.3.0 or later) if possible.

Many thanks in advance.

+1  A: 

In your project, go to the properties on the StyleCop reference. Try setting the "Specific Version" property to false.

David
This only affects compile time linking.
Jennifer Zouak
+5  A: 

Yes you should just install the same version for the other developers. If you do not, you may have unpredictable runtime failures due to changes within StyleCop. Presumably that is why they bothered to increment the version number.

If you don't want to do this, you can configure a different assembly binding in the app.config file. In the config the actual version number which you intend to use at runtime is needed. And yes, this can even be done via policy. But again, I think you are better served by including the correct DLL in the first place.

Jennifer Zouak
Yeah, the problem is where as well. If i install the DLLs I reference in the GAC, it breaks StyleCop because apparently StyleCop starts looking for its other dependencies there or something. Odd. So, I think I'm left with constraining users to StyleCop 4.3.3.0 and releasing a new version when StyleCop goes up a version.
Jim