dotnet / dotnet/msbuild

[Bug]: Projects with long descriptions (>~16k) don't emit FileVersion in the produced DLLs

Open
#8,720 6 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Issue Description

When compiling a versioned csproj with a Description property that is bigger than 16k, the FileVersion (+ other attributes) of the DLL stop being emitted.

I've attached a repro where the `ConsoleApp4` project has a description of length 17k while `ConsoleApp5` has 16k. When compiling the two DLLs and comparing their file attributes:

image

image

I am not sure why this is happening but if the Description property has a limit shouldn't it be enforced with an error during the build rather than silently passing with missing info in the built DLL?

My use case here is I want to bundle the CHANGELOG.md file when I publish packages, so it's reasonable to add a `Substring`, to the `Description` but should I have to do that?

### Steps to Reproduce

Steps to reproduce:
1. Run `dotnet build` on the root of the solution
2. Look at the generated DLLs and the respective bin/Debug folders

[BugRepro.zip](https://github.com/dotnet/msbuild/files/11372201/BugRepro.zip)

### Expected Behavior

The File version / Product version should be populated in ConsoleApp4.dll

### Actual Behavior

The File version / Product version is empty in ConsoleApp4.dll

### Analysis

_No response_

### Versions & Configurations

msbuild -version
MSBuild version 17.5.1+f6fdcf537 for .NET Framework
17.5.1.16304

dotnet --version
7.0.203

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with BugRepro.zip and run dotnet build on the root solution, comparing the generated DLL attributes for ConsoleApp4 and ConsoleApp5. Trace how the Description property becomes assembly metadata; done means the version and product version are populated for the project with the 17k description, or the build reports an explicit limit error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.