Home All Groups Group Topic Archive Search About

Using different references based on "build"

Author
26 Dec 2006 11:02 PM
Bruce
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

Author
27 Dec 2006 1:59 AM
Bruce W. Darby
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

Show quoteHide quote
"Bruce" <Bruce@nospam.com> wrote in message
news:uHmk3HUKHHA.3668@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
Author
27 Dec 2006 2:12 AM
Bruce
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
Author
27 Dec 2006 2:38 AM
Stephany Young
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
Show quoteHide quote
"Bruce" <Bruce@nospam.com> wrote in message
news:u1t4ByVKHHA.1252@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
Author
27 Dec 2006 3:11 AM
Bruce
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
Author
27 Dec 2006 2:23 PM
Michel Posseth [MCP]
Why not use conditional compilation contstants when loading the assembly  ?

like this


# IF DEBUG THEN
# ELSE
# END IF

regards

Michel


Show quoteHide quote
"Bruce" <Bruce@nospam.com> schreef in bericht
news:udMfvSWKHHA.1044@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
Author
27 Dec 2006 3:11 PM
Bruce
Michel Posseth [MCP] wrote:
Show quoteHide quote
> 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
Author
27 Dec 2006 8:01 PM
Michel Posseth [MCP]
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/default.asp?url=/library/en-us/vblr7/html/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



Show quoteHide quote
"Bruce" <Bruce@nospam.com> schreef in bericht
news:uCO9GlcKHHA.1912@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
Author
27 Dec 2006 4:38 PM
Jay B. Harlow (Jay.Harlow@gmail.com)
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.com> wrote:
Show quoteHide quote
> 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