Solved

Creating a release version of a DLL with a separate GUID

Posted on 2013-06-05
2
317 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

831 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