Assembly Versioning

 

  1. 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.

  1.  In the command window, type

gacutil /i ASampleClass.dll

  1. In Windows Explorer view the contents of C:\Winnt\Assembly to find the assembly that you just added.
  2. Note the version of the assembly that has been cached.
  3. 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.
  4. Compile the code and execute it.
  5. The output should be Sample information.
  6. Now open the ASampleClass and modify the getInformation method of Info class to return “Sample NEW Information.”
  7. Compile, and run the gacutil again to push the change to the global cache.
  8. View the global assembly cache using windows explorer.
  9. You will notice two version of the ASampleClass assembly.
  10. Now run the User.exe without recompilation (by double clicking on the User.exe in Windows Explorer).
  11. Note from the output that the program still is using the older version.
  12. Now recompile User and try running to see if it uses the newer version.