By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

Using different references based on "build"

P: n/a

I am using VB in Vs2005. Am I missing something or does VB not have the
concept of "builds" (release/debug) like in VC? I wrote an assembly
and I would like to have a debug version of the DLL and a release
version of the DLL. I would like to create some sample code that
demonstrates my assembly in VB and would like to have two builds, one
using my debug version and the other using the release version of the
assembly.

How can I do this? I can't see how in VB.

P.S. I am currently using the Express version so perhaps that explains
why I am not seeing this?


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Dec 26 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Bruce,

If you right-click on your project in the Solution Explorer and select Open,
it will bring you to the properties dialog. Compile or Debug should do ya.
:) Hope this helps.

Bruce

"Bruce" <Br***@nospam.comwrote in message
news:uH**************@TK2MSFTNGP02.phx.gbl...
>
I am using VB in Vs2005. Am I missing something or does VB not have the
concept of "builds" (release/debug) like in VC? I wrote an assembly and
I would like to have a debug version of the DLL and a release version of
the DLL. I would like to create some sample code that demonstrates my
assembly in VB and would like to have two builds, one using my debug
version and the other using the release version of the assembly.

How can I do this? I can't see how in VB.

P.S. I am currently using the Express version so perhaps that explains
why I am not seeing this?


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Dec 27 '06 #2

P: n/a
Bruce W. Darby wrote:
Bruce,

If you right-click on your project in the Solution Explorer and select Open,
it will bring you to the properties dialog. Compile or Debug should do ya.
:) Hope this helps.

Thanks Bruce. I know how to bring up the properties box. I can see
the debug tab. But I don't think that is what I want.

What I want to do is use one external referenced assembly for debug and
another for release. I just see one set of references period.

Bruce


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Dec 27 '06 #3

P: n/a
Now I can see what you are attempting.

Assuming that your 'external assembly' was also developed in VS 2005, then
simply add your 'external project' to your current solution, change the
reference to it to be 'project' rather than 'file', then, when you compile
your current project in 'debug', it will use the 'debug' version of your
'external assembly' and when you compile your current project in 'release'
it will use the 'release' version of your 'external assembly'.
and make your current project If you add the project for your
"Bruce" <Br***@nospam.comwrote in message
news:u1**************@TK2MSFTNGP02.phx.gbl...
Bruce W. Darby wrote:
>Bruce,

If you right-click on your project in the Solution Explorer and select
Open, it will bring you to the properties dialog. Compile or Debug should
do ya. :) Hope this helps.

Thanks Bruce. I know how to bring up the properties box. I can see the
debug tab. But I don't think that is what I want.

What I want to do is use one external referenced assembly for debug and
another for release. I just see one set of references period.

Bruce


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Dec 27 '06 #4

P: n/a
Stephany Young wrote:
Now I can see what you are attempting.

Assuming that your 'external assembly' was also developed in VS 2005, then
simply add your 'external project' to your current solution, change the
reference to it to be 'project' rather than 'file', then, when you compile
your current project in 'debug', it will use the 'debug' version of your
'external assembly' and when you compile your current project in 'release'
it will use the 'release' version of your 'external assembly'.

But the external assembly is written in C++, so there are two different
file names for the assembly MyAssemblyD.Dll for debug and MyAssembly.DLL
for release.

Plus remember that these are sample VB projects so, once if I
distribute them then they will not work because the person getting the
samples will not have my project.

I would have to change the VB project anyway so I might as well switch
between the debug and release version of the external assembly DLL.

It is hard to believe that VB does not have a way to build using
different parameters from one project. But I guess it is so?

Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Dec 27 '06 #5

P: n/a
Why not use conditional compilation contstants when loading the assembly ?

like this
# IF DEBUG THEN
# ELSE
# END IF

regards

Michel
"Bruce" <Br***@nospam.comschreef in bericht
news:ud**************@TK2MSFTNGP02.phx.gbl...
Stephany Young wrote:
>Now I can see what you are attempting.

Assuming that your 'external assembly' was also developed in VS 2005,
then simply add your 'external project' to your current solution, change
the reference to it to be 'project' rather than 'file', then, when you
compile your current project in 'debug', it will use the 'debug' version
of your 'external assembly' and when you compile your current project in
'release' it will use the 'release' version of your 'external assembly'.


But the external assembly is written in C++, so there are two different
file names for the assembly MyAssemblyD.Dll for debug and MyAssembly.DLL
for release.

Plus remember that these are sample VB projects so, once if I distribute
them then they will not work because the person getting the samples will
not have my project.

I would have to change the VB project anyway so I might as well switch
between the debug and release version of the external assembly DLL.

It is hard to believe that VB does not have a way to build using different
parameters from one project. But I guess it is so?

Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Dec 27 '06 #6

P: n/a
Michel Posseth [MCP] wrote:
Why not use conditional compilation contstants when loading the assembly ?

like this
# IF DEBUG THEN
# ELSE
# END IF

regards

Michel
Thanks Michel,

Where do I put this? All I see is a list of references. I am not a VB
programmer, I am a C++ programmer trying to write some sample code for
my C++ assembly.

Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Dec 27 '06 #7

P: n/a
Bruce,
In addition to the other comments.
It is hard to believe that VB does not have a way to build using
different parameters from one project. But I guess it is so?
VB *does* have a way to build using different parameters!

However by default it is turned off. Use "Tools - Options - Projects
and Solutions - General - Show Advanced Build Configurations" to enable
or disable the feature. Once you enable this option you will have both
Release & Debug builds available.

The caveat is, there are not different References based on Release &
Debug builds per se.

What I normally do is use output folders to hold my Release & Debug
builds of my C++, VB, or C# projects, rather then use file names. Then
I will put the C++, VB, or C# projects all in one solution. Where each
project references the other project, *by project* (not file!) This way
the Release build of the VB project will use the output of the Release
build of the C++ project, likewise the Debug build of the VB project
will use the output of the Debug build of the C++ project. Considering
that I build the entire solution...

Having said that I suspect (but have not tested) that you could change
the output name of the C++ assembly within the respective Debug or
Release configuration & the respective VB build will respectively use
named C++ assembly. Again based on using Project references within a
solution & not file references. Again I have not tested this theory.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


On Dec 26, 9:11 pm, Bruce <B...@nospam.comwrote:
Stephany Young wrote:
Now I can see what you are attempting.
Assuming that your 'external assembly' was also developed in VS 2005, then
simply add your 'external project' to your current solution, change the
reference to it to be 'project' rather than 'file', then, when you compile
your current project in 'debug', it will use the 'debug' version of your
'external assembly' and when you compile your current project in 'release'
it will use the 'release' version of your 'external assembly'.But the external assembly is written in C++, so there are two different
file names for the assembly MyAssemblyD.Dll for debug and MyAssembly.DLL
for release.

Plus remember that these are sample VB projects so, once if I
distribute them then they will not work because the person getting the
samples will not have my project.

I would have to change the VB project anyway so I might as well switch
between the debug and release version of the external assembly DLL.

It is hard to believe that VB does not have a way to build using
different parameters from one project. But I guess it is so?

Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPSwww.stempsoft.com
Dec 27 '06 #8

P: n/a
Well you could implement a interface , and load the assembly dynamicly
through code ( by implementing an interface you keep intellisense )

with the method i described ( with conditional compilation contstants )

http://msdn.microsoft.com/library/de...ml/vadirIf.asp

I use this method since VB6 in my projects as i had a lot of customers with
different wishes but the basic source of most of my programs is just one
sourcecode
as i did not want my progies to get bloated by unnecesary source from wishes
of differnt customers i implemented coditional compilation .

So building your proggy with the debug switch on will result in a different
code flow in your application

hth

regards

Michel

"Bruce" <Br***@nospam.comschreef in bericht
news:uC**************@TK2MSFTNGP03.phx.gbl...
Michel Posseth [MCP] wrote:
>Why not use conditional compilation contstants when loading the assembly
?

like this
# IF DEBUG THEN
# ELSE
# END IF

regards

Michel


Thanks Michel,

Where do I put this? All I see is a list of references. I am not a VB
programmer, I am a C++ programmer trying to write some sample code for my
C++ assembly.

Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Dec 27 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.