Assemblies and when strong naming is not an option?

A back, I asked the following question here: Stack Overflow, Assembly names and versions .

Now I realized that I can not sign my assembly with a strong name, since one of the third-party dependencies is not a strongly named assembly, and therefore mine is not amenable to subscription.

I tried to just change the assembly file name MyAssembly.dll to MyAssembly.v.1.1.dll, but when I do this and refer to the renamed assembly, it does not copy like the rest of the links. There seems to be a mismatch between the file name and the Identity attribute of the assembly.

I have projects A and B that are dependencies of project C. Project A must reference MyAssembly.dll v.1.0, and Project B must reference MyAssembly.dll v.2.0 so that both can be located in Project C bin / Release

What to do? How can i fix this?

+3
source share
4 answers

Ideally, any reputable third-party assembly developer signs their assemblies. I would try the following:

  • See if you can contact a third-party assembly provider and ask them to sign for you.
  • If the third-party assembly provider is open source, download and compile the source yourself using a strong name. (Think about going back to the project).

Otherwise (as long as the license allows this):

  • ildasm.exe ilasm.exe :

    ildasm.exe/out:TheAssembly.il TheAssembly.dll

    ilasm.exe TheAssembly.il/key=MyKey.snk/dll/output=TheAssembly.dll

  • ILMerge, .

, , , .

!

+8

ILMerge, , .

+5

, . , , - (, , , ). , , .

+1

( ), . , , .

ILMerge .

I wrote an application to automatically sign any managed .NET assembly to overcome all these limitations and complete this seemingly simple task. This can be done from the user interface, command line or software API, depending on your requirements. You can learn more about this application and download it here: http://brutaldev.com/post/2013/10/18/NET-Assembly-Strong-Name-Signer

0
source

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


All Articles