2013年5月28日 星期二

C# Fundation, Part 3 (Assemblies & References)

Assemblies

1. GAC: Global Assembly Cache

2. System assemblies only store a single copy for a machine

image

 

References

image

 

Example:

If we have 2 projects in a solution, one project (for example, ClassDefintion) is for all classes defintion and the other one is main project (for example, MyApp). So we have to add reference of ClassDefintion in MyApp project.

Two steps must be taken, otherwise we will encounter missing a using directive or an assembly referenc? error

1. Add reference

2. Using directive

image

 

Assembly & Reference

1. Add ClassDefintion Reference in MyApp project

2. Will result in ClassDefintion Assembly in MyApp project folder

3. So when MyApp project execute, both MyApp & ClassDefintion assemblies loading at run time

image

沒有留言:

張貼留言