Can someone explain how to make assembly info correctly?
This is my AssemblyInfo.cs:
[assembly: AssemblyTitle("Title")]
[assembly: AssemblyDescription("Description")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mycompany")]
[assembly: AssemblyProduct("ProductName")]
[assembly: AssemblyCopyright("Copyright ©")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(true)]
[assembly: Guid("xxxxxx-xxxxx-xxxxx")]
[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]
and this is how it is shown in properties window:
You can see that Description and Language is not same as in AssemblyInfo.cs.
Also something is wrong with AssemblyCompany because when I open startup keys in ccleaner, company field is empty for my program...
What am I doing wrong?
Windows doesn't know beans about managed assembly attributes. What you actually see is an unmanaged resource that's embedded in the assembly. The C# compiler auto-generates it from the attribute values in your AssemblyInfo.cs file. You can see it yourself with File + Open + File, select your .dll or .exe file. Double-clicking the Version.1 resource opens the unmanaged resource editor, the one you use in a C++ project.
The mapping from managed attributes to that unmanaged version resource is imperfect. Note for example that you cannot see the [AssemblyVersion] attribute value. Extremely important in .NET, Windows only displays the [AssemblyFileVersion] attribute value.
And culture is certainly such an impedance mismatch. A .NET assembly that contains code always has AssemblyName.CultureName set to "*". Only satellite assemblies have a culture. And title vs description, the unmanaged version resource has only one field that qualifies, they selected [AssemblyTitle] to map to that field.
You can create your own unmanaged version resource with a resource script, compile it with rc.exe. You use Project + Properties, Application tab, Resource file radio button to tell the C# compiler about it. You are unlikely to enjoy it much, constantly updating and recompiling the resource script to keep the version number in sync is going to wear you out quickly unless you can automate that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With