Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

Question about assembly info in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 19 Nov 2006 13:54 GMT
Hi,

I have experience in Java and C++ but I am rather new to C# and just
started learning it. I am using Visual C# 2005 Express Edition and I
found that there is a file called "AssemblyInfo.cs", which is something
like I attached below. Would anyone please let me know what is the
purpose of this file? Or are there any equivalent stuff I can imagine
in C++ or Java?

Thanks a lot.
Paul

----------------------------
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the
following
// set of attributes. Change these attribute values to modify the
information
// associated with an assembly.
[assembly: AssemblyTitle("BasicTest1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("paul2")]
[assembly: AssemblyProduct("BasicTest1")]
[assembly: AssemblyCopyright("Copyright © paul2 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not
visible
// to COM components.  If you need to access a type in this assembly
from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("c1dc9d39-85e1-47fc-975d-28d982cd2174")]

// Version information for an assembly consists of the following four
values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Dave Sexton - 19 Nov 2006 14:33 GMT
Hi Paul,

"AssemblyInfo.cs" is a normal C# file (.cs) that is created by VS 2005 when you create a new
project.  It's purpose is to encapsulate assembly-level attributes, which provide meta-data for your
compiled assembly.

// C# using directive adds the specified namespace to the file's scope
// so you can code "MethodInfo" in this file, for instance, without having to
// qualify it with a namespace: System.Reflection.MethodInfo.
// (Note: The using statement (different) can be used to ensure
// the disposal of objects that implement the IDisposable interface just
// like you would using try..finally in a method body, but here is a directive).
using System.Reflection;

// AssemblyTitleAttribute (the Attribute part can be left off in C# when the
// class is being used between [] characters) is being used on the Assembly
// as meta-data.
// "assembly:" applies the AssemblyTitleAttribute to the assembly in which
// AssemblyInfo.cs will be compiled.
// The title given for the Assembly is "BasicTest1".  This is just meta-data,
// which isn't used by the CLR.
[assembly: AssemblyTitle("BasicTest1")]

The rest of the statements are also just Attributes being used for assembly-level meta-data.  Check
out the MSDN docs for each one for more information (don't forget to search for the name used here
and Attribute (e.g., GuidAttribute).

"Attributes (C# Programming Guide)"
http://msdn2.microsoft.com/en-us/library/z0w1kczw.aspx

"C# using Directive"
http://msdn2.microsoft.com/en-gb/library/sf0df423.aspx

"C# using Statement"
http://msdn2.microsoft.com/en-gb/library/yh598w02.aspx

Signature

Dave Sexton

Hi,

I have experience in Java and C++ but I am rather new to C# and just
started learning it. I am using Visual C# 2005 Express Edition and I
found that there is a file called "AssemblyInfo.cs", which is something
like I attached below. Would anyone please let me know what is the
purpose of this file? Or are there any equivalent stuff I can imagine
in C++ or Java?

Thanks a lot.
Paul

----------------------------
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the
following
// set of attributes. Change these attribute values to modify the
information
// associated with an assembly.
[assembly: AssemblyTitle("BasicTest1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("paul2")]
[assembly: AssemblyProduct("BasicTest1")]
[assembly: AssemblyCopyright("Copyright © paul2 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not
visible
// to COM components.  If you need to access a type in this assembly
from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("c1dc9d39-85e1-47fc-975d-28d982cd2174")]

// Version information for an assembly consists of the following four
values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Arne Vajhøj - 19 Nov 2006 21:17 GMT
> I have experience in Java and C++ but I am rather new to C# and just
> started learning it. I am using Visual C# 2005 Express Edition and I
> found that there is a file called "AssemblyInfo.cs", which is something
> like I attached below. Would anyone please let me know what is the
> purpose of this file? Or are there any equivalent stuff I can imagine
> in C++ or Java?

Consider it equivalent to the manifest in a jar file.

Arne

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.