Browse Source

Restore Properties/AssemblyInfo.cs so the DLL gets the right version

Master's manual ILSpy/Properties/AssemblyInfo.cs was dropped during
the Avalonia port; the SDK's auto-generated AssemblyInfo took over
with default-zero versions. As a result the built ILSpy.dll's
assembly metadata read 1.0.0.0 even though DecompilerVersionInfo
(the static class generated from the .template by the build pipeline)
had the right values. Anything that queried Assembly.GetName().Version
or AssemblyInformationalVersionAttribute -- update checks, crash
report context, the title-bar version line we still need to wire --
got the SDK default, not the real revision.

Port the cross-platform-safe slice of master's AssemblyInfo.cs:
Title/Description/Company/Product/Copyright, ComVisible(false), the
two version attributes pointing at DecompilerVersionInfo,
NeutralResourcesLanguage, InternalsVisibleTo("ILSpy.Tests"), and the
CA2243 suppression. Deliberately skipped: [SupportedOSPlatform(
"Windows7.0")] and [TargetPlatform("Windows10.0")] (would re-make the
assembly Windows-only at metadata level and emit CA1416 noise for
cross-platform code paths), [InternalsVisibleTo("ILSpy.AddIn")] (the
AddIn project isn't in the avalonia build path), and the WPF-only
Properties/WPFAssemblyInfo.cs ThemeInfo (System.Windows-typed).

The single-line ILSpy/AssemblyInfo.cs stub that only carried the
ILSpy.Tests InternalsVisibleTo gets folded into the new file and
removed, matching master's layout.

GenerateAssemblyInfo=false in the csproj is the required companion --
without it the SDK emits a second AssemblyVersion attribute and
compilation fails with CS0579.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
dd79acd2b9
  1. 6
      ILSpy/ILSpy.csproj
  2. 23
      ILSpy/Properties/AssemblyInfo.cs

6
ILSpy/ILSpy.csproj

@ -11,6 +11,12 @@ @@ -11,6 +11,12 @@
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<RootNamespace>ICSharpCode.ILSpy</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- Properties/AssemblyInfo.cs sets [assembly: AssemblyVersion(...)] from
DecompilerVersionInfo (which the build pipeline rewrites with the live
git revision). The SDK auto-generated AssemblyInfo would overwrite those
with whatever <Version> resolves to in the project, defeating the dynamic
version injection. -->
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<!-- ILSpy is committed to System.Composition with attribute-driven discovery
(matching the WPF host); MEF002 nudges toward code-based DI which doesn't apply.
CA1001/CA2213 are suppressed in the WPF csproj for the same reason — tab page

23
ILSpy/AssemblyInfo.cs → ILSpy/Properties/AssemblyInfo.cs

@ -16,6 +16,29 @@ @@ -16,6 +16,29 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ILSpy")]
[assembly: AssemblyDescription(".NET assembly inspector and decompiler")]
[assembly: AssemblyCompany("ic#code")]
[assembly: AssemblyProduct("ILSpy")]
[assembly: AssemblyCopyright("Copyright 2011-2026 AlphaSierraPapa for the SharpDevelop Team")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// COM visibility: assembly is not exposed to COM. Harmless on non-Windows platforms;
// mirrors master's contract so the metadata flows identically on Windows builds.
[assembly: ComVisible(false)]
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: InternalsVisibleTo("ILSpy.Tests")]
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
Loading…
Cancel
Save