469,963 Members | 1,806 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

How can I reference a different .NET dll based on debug/release mode?

I reference a .NET DLL to import some of my custom types. I can build that
DLL in debug or release mode, but I usually keep the debug one built so I
can debug it. When I want to link to the release version of the DLL, I find
that I have to remove the reference from the project and point VS. NET to
the release version of the DLL. Is there some way to do this automatically,
like it usually done in the past, so that the release/debug switch can work
as expected?

Thanks!

Scott Yost
Nov 17 '05 #1
2 3746
An easy workaround is to not use the reference mechanism and use the
compiler switch /FU and point to the desired dll based on the configuration
in the project settings.

Another one less easier is #using conditioned by the _DEBUG macro in
source files that reference that assembly.
e.g.

#ifdef _DEBUG
#using "mydebugdll.dll"
#else
#using "myreleasedll.dll"
#endif
Silviu Guea, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.
--------------------
| From: "Scott Yost" <tr***************@hotmail.com>
| Subject: How can I reference a different .NET dll based on debug/release
mode?
| Date: Tue, 27 Apr 2004 15:38:40 -0500
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <eP**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vc
| NNTP-Posting-Host: reno.cs.purdue.edu 128.10.9.108
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vc:36162
| X-Tomcat-NG: microsoft.public.dotnet.languages.vc
|
| I reference a .NET DLL to import some of my custom types. I can build that
| DLL in debug or release mode, but I usually keep the debug one built so I
| can debug it. When I want to link to the release version of the DLL, I
find
| that I have to remove the reference from the project and point VS. NET to
| the release version of the DLL. Is there some way to do this
automatically,
| like it usually done in the past, so that the release/debug switch can
work
| as expected?
|
| Thanks!
|
| Scott Yost
|
|
|
Nov 17 '05 #2
This does do the trick, except that I now need to manually copy the
appropriate DLL into the directory each time because the references
mechanism no longer takes care of it.
I'm guessing there's no perfect solution to this problem at the moment.
Thank you!
"Silviu Guea [MSFT]" <si*****@online.microsoft.com> wrote in message
news:P6**************@cpmsftngxa10.phx.gbl...
An easy workaround is to not use the reference mechanism and use the
compiler switch /FU and point to the desired dll based on the configuration in the project settings.

Another one less easier is #using conditioned by the _DEBUG macro in
source files that reference that assembly.
e.g.

#ifdef _DEBUG
#using "mydebugdll.dll"
#else
#using "myreleasedll.dll"
#endif
Silviu Guea, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.
--------------------
| From: "Scott Yost" <tr***************@hotmail.com>
| Subject: How can I reference a different .NET dll based on debug/release
mode?
| Date: Tue, 27 Apr 2004 15:38:40 -0500
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <eP**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vc
| NNTP-Posting-Host: reno.cs.purdue.edu 128.10.9.108
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13 phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vc:36162
| X-Tomcat-NG: microsoft.public.dotnet.languages.vc
|
| I reference a .NET DLL to import some of my custom types. I can build that | DLL in debug or release mode, but I usually keep the debug one built so I | can debug it. When I want to link to the release version of the DLL, I
find
| that I have to remove the reference from the project and point VS. NET to | the release version of the DLL. Is there some way to do this
automatically,
| like it usually done in the past, so that the release/debug switch can
work
| as expected?
|
| Thanks!
|
| Scott Yost
|
|
|

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by ss | last post: by
reply views Thread by Todd H | last post: by
7 posts views Thread by Srinivasa Rao | last post: by
3 posts views Thread by mosscliffe | last post: by
3 posts views Thread by =?Utf-8?B?ZWxhZGxh?= | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.