Solved

Creating a release version of a DLL with a separate GUID

Posted on 2013-06-05
2
321 Views
Last Modified: 2013-06-08
I am writing a class library in VB.Net for interop use with excel (using VS 2012). The machine (a server running Windows Server 2008 R2 Standard) which holds the excel file and the dll is the same machine on which I am developing the dll.
      With the way it is set up now, I open VS and make changes to the library, then I save it and build it. From that point on, my excel file with reference the newly built dll. But if I mess something up in the dll or have to stop half way and leave some code unfinished, the deployed, active excel file is still referencing the dll which is under development.
      I want to be able to build a development version of the the dll and then, when its ready, deploy that dll separately (but on the same machine) as the dll which the excel file will be using as a reference.
      I figured out how to requester two versions of the for com interop dll by creating a copy of the project and changing the GUID for the assembly. The problem is that it takes too long and seems a bit sloppy- to have to copy the whole project and change the GUID and the compile path manually.
      I want to know if I can somehow set up a way to systematically change the GUID when I’m ready to deploy the new version of the dll, and then change it back to the old GUID once it’s done being deployed.
      Is there any way to do this quickly and efficiently?
0
Comment
Question by:BROOKLYN1950
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39225290
How about you use conditional compilation? You could open up the AssemblyInfo.vb file within your project and do something like:

'The following GUID is for the ID of the typelib if this project is exposed to COM
#If DEBUG Then
<Assembly: Guid("81793ebf-260e-4cb3-8f1f-e5cafb5e9d1f")> 
#Else
<Assembly: Guid("36B623DA-2BD2-41EA-B9AE-0EDCBF5155EE")> 
#End If

Open in new window


When you are compiling under the DEBUG configuration the first GUID will be assigned to the assembly; when you are under RELEASE (or technically anything that is not DEBUG, since it's an "Else" in the above) the second GUID will be assigned.
0
 

Author Closing Comment

by:BROOKLYN1950
ID: 39231805
Thanks a lot
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question