Solved

Creating a release version of a DLL with a separate GUID

Posted on 2013-06-05
2
330 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

717 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