15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

436 ❘ ChaPTer 18 Assemblies<br />

which belongs to the assembly. Classes exported<br />

from modules are part of the assembly manifest;<br />

classes exported from the assembly itself are not.<br />

What’s the purpose of modules Modules can<br />

be used for faster startup of assemblies because<br />

not all types are inside a single file. The modules<br />

are loaded only when needed. Another reason to<br />

use modules is if you want to create an assembly<br />

with more than one programming language.<br />

One module could be written using Visual Basic,<br />

another module could be written using <strong>C#</strong>, <strong>and</strong><br />

these two modules could be included in a single<br />

assembly.<br />

assembly attributes<br />

figure 18-5<br />

When creating a Visual Studio project, the source file AssemblyInfo.cs is generated automatically. You can<br />

find this file below Properties in Solution Explorer. You can use the normal source code editor to configure<br />

the assembly attributes in this file. This is the file generated from the project template:<br />

using System.Reflection;<br />

using System.Runtime.CompilerServices;<br />

using System.Runtime.InteropServices;<br />

//<br />

// General Information about an assembly is controlled through the following<br />

// set of attributes. Change these attribute values to modify the information<br />

// associated with an assembly.<br />

//<br />

[assembly: AssemblyTitle("DomainTest")]<br />

[assembly: AssemblyDescription("")]<br />

[assembly: AssemblyConfiguration("")]<br />

[assembly: AssemblyCompany("")]<br />

[assembly: AssemblyProduct("DomainTest")]<br />

[assembly: AssemblyCopyright("Copyright @ 2010")]<br />

[assembly: AssemblyTrademark("")]<br />

[assembly: AssemblyCulture("")]<br />

// Setting ComVisible to false makes the types in this assembly not visible<br />

// to COM components. If you need to access a type in this assembly from<br />

// COM, set the ComVisible attribute to true on that type.<br />

[assembly: ComVisible(false)]<br />

// The following GUID is for the ID of the typelib if this project is exposed<br />

// to COM<br />

[assembly: Guid("ae0acc2c-0daf-4bb0–84a3-f9f6ac48bfe9")]<br />

//<br />

// Version information for an assembly consists of the following four<br />

// values:<br />

//<br />

// Major Version<br />

// Minor Version<br />

// Build Number<br />

// Revision<br />

//<br />

[assembly: AssemblyVersion("1.0.0.0")]<br />

[assembly: AssemblyFileVersion("1.0.0.0")]<br />

This file is used for configuration of the assembly manifest. The compiler reads the assembly attributes to<br />

inject the specific information into the manifest.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!