Solved

Creating a release version of a DLL with a separate GUID

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

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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 how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now