Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set description for programmatically generated assembly in C#

How can I set assembly description?

I'm generating assembly programmatically

CodeDomProvider.CreateProvider("C#").CompileAssemblyFromFile(parameters, files);

But i don't know where are assembly properties. is there any way to set these?

like image 635
Simon Avatar asked Mar 21 '26 12:03

Simon


1 Answers

CompileAssemblyFromFile takes an array of files. Include AssemblyInfo.cs file with required attributes, like

[assembly: AssemblyTitle("My Assembly Name")]
[assembly: AssemblyDescription("")]
[assembly: Guid("594dd732-1e7d-4981-ada3-efb341e5f918")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

AssemblyInfo.cs is a file, which added by Visual Studio to any project by default. You can name it whatever you want, but i suggest to stick with this convention.

like image 147
Ilya Ivanov Avatar answered Mar 24 '26 02:03

Ilya Ivanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!