C # assembly required to reference a strongly named assembly

So here is the problem. I am writing some builds of StyleCop plugins for use in the company I work for. Therefore, these assemblies should reference Microsoft.StyleCop.CSharp.dll, for example, which is strongly named.

The problem is that if I create this and pass it on to the developers in my group, they must have the same version of StyleCop DLL (currently 4.3.3.0) or not load.

What is the best way to make my extra rules more independent? Should I just install version 4.3.3.0 of these subordinate DLLs of StyleCop files in the GAC? Can the assembly (compared to the application) use the policy file?

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

Thank you very much in advance.

+4
source share
2 answers

Yes, you should just install the same version for other developers. If you do not, you may experience unpredictable crashes while making changes to StyleCop. This is probably why they bothered to increase the version number.

If you do not want to do this, you can configure another assembly binding in the app.config file. The configuration requires the actual version number that you intend to use at run time. And yes, this can be done even with the help of politics. But then again, I think it's best for you to include the correct DLL.

+5
source

In your project, navigate to the properties in the StyleCop link. Try setting the Specific Version property to false.

+1
source

Source: https://habr.com/ru/post/1306806/


All Articles