Compiled file properties

  • Thread starter Thread starter Ivan Demkovitch
  • Start date Start date
I

Ivan Demkovitch

Hi!

I'm using csc to compile my *.cs classes (for asp.net)

How do I add things like version No, Description and Copyright to the file?
 
They are compiled in as resources I believe. To do this you need to create a
..resx file, using either a few lines of C# code which is available on MSDN
that makes a command line utility, or a 3rd party component, I recommend the
former. You then use resgen.exe to compile this into a .resources file. The
csc.exe is then pointed at this in addition to the .cs file.
 
In Visual Studio, these information is stored in AssemblyInfo.cs file. The file contains code like this

[assembly: AssemblyTitle("")
[assembly: AssemblyDescription("")
[assembly: AssemblyConfiguration("")
[assembly: AssemblyCompany("")
[assembly: AssemblyProduct("")
[assembly: AssemblyCopyright("")
[assembly: AssemblyTrademark("")
[assembly: AssemblyCulture("")]

I believe that you can put these lines in any source, just only keep one occurence for assembly
 
Nope.
Doesn't work this way:
Get compiler error:
"The type or namespace name "AssemblyTitle" could not be found (are you
missing....)"



boudino said:
In Visual Studio, these information is stored in AssemblyInfo.cs file. The file contains code like this:

[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

I believe that you can put these lines in any source, just only keep one occurence for assembly.
Community Website: http://www.dotnetjunkies.com/newsgroups/
 
You forgot to put these at the top of the file.

using System.Reflection;
using System.Runtime.CompilerServices;
 
Back
Top