Assembly Versioning
- First compile the ASampleClass solution (project). Open a command line
window as follows:
(a) Click on Start, Programs, Microsoft Visual Studio
.NET, Visual Studio .NET Tools, Visual Studio .NET Command Prompt.
(b) In the command window type the word cd followed by a space. Do not hit return.
(c) Keep the command window on left and bring up the
windows explorer on the right of the monitor.
(d) In the windows explorer, go to the director that
contains this file.
(e) Drag the ASampleClass
directory from windows explorer to the command window.
(f) Set focus on the command window and hit return.
(g) type cd
bin\debug and hit return again.
- In the command window, type
gacutil
/i ASampleClass.dll
- In Windows Explorer
view the contents of C:\Winnt\Assembly to find the assembly that you just
added.
- Note the version of
the assembly that has been cached.
- Now open the User
solution (project), and click on Project, Add References. Now click on the
Browser button and navigate to the ASampleClass\bin\Debug
directory and pick the ASampleClass.dll. Click Open. Click OK now.
- Compile the code and
execute it.
- The output should be
Sample information.
- Now open the ASampleClass and modify the getInformation
method of Info class to return “Sample NEW Information.”
- Compile, and run the gacutil again to push the change to the global cache.
- View the global
assembly cache using windows explorer.
- You will notice two
version of the ASampleClass assembly.
- Now run the User.exe
without recompilation (by double clicking on the User.exe in Windows
Explorer).
- Note from the output
that the program still is using the older version.
- Now recompile User and
try running to see if it uses the newer version.