dotnet / ILMerge

ILMerge is a static linker for .NET Assemblies.
MIT License
1.23k stars 170 forks source link

AllowPartiallyTrustedCallers attribute missed after merge #28

Open RusKnyaz opened 6 years ago

RusKnyaz commented 6 years ago

Assemblies initialiy compiled with [assembly: AllowPartiallyTrustedCallers] lost this attribute after merge. Steps to reproduce:

  1. Create new class library project (targetFramework: 3.5)
  2. Add line "[assembly: AllowPartiallyTrustedCallers]" to AssembliInfo.cs
  3. Call ILMerge by "Ilmerge /out:out.dll ClassLibrary1.dll /targetplatform:v2" command
  4. open out.dll in ILSpy or Reflector or any other tool Observed: there is no 'AllowPartiallyTrustedCallers' assembly attribute Expected: AllowPartiallyTrustedCallers attribute should be specified for the assembly (like in original ClassLibrary1.dll).
cwellsx commented 6 years ago

I found the source code which implements this restriction (it's easy to find), and posted on StackOverflow to ask why this restriction was introduced into the code -- Why does ILMerge delete security-related attributes?