How do I choose debug/release version of C# DLL?

P

Peter Steele

I've written a C# DLL that I want to include in my other C# projects. What I
want to do is include the Debug version of the DLL when I am building the
other apps in debug mode and Release version of the DLL when I'm building in
release mode. This is quite easy to do in VC++ using various macros that are
available in the project file. I can't seem to do the same thing when using
a C# DLL in a C# project. Is there a way to do this?
 
N

Nicholas Paldino [.NET/C# MVP]

Peter,

In this case, you would just want to include the actual project in the
solution which contains the other project. This way, it will inherit all of
the project settings and you will run in the appropriate mode.

Otherwise, you will have to change the references each time, since you
won't be able to store the two dlls in the same directory.

Hope this helps.
 
P

Peter Steele

So I take it you cannot use macros like $(IntDir) in C# like you can in
VC++?

Nicholas Paldino said:
Peter,

In this case, you would just want to include the actual project in the
solution which contains the other project. This way, it will inherit all
of the project settings and you will run in the appropriate mode.

Otherwise, you will have to change the references each time, since you
won't be able to store the two dlls in the same directory.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Steele said:
I've written a C# DLL that I want to include in my other C# projects.
What I want to do is include the Debug version of the DLL when I am
building the other apps in debug mode and Release version of the DLL when
I'm building in release mode. This is quite easy to do in VC++ using
various macros that are available in the project file. I can't seem to do
the same thing when using a C# DLL in a C# project. Is there a way to do
this?
 
N

Nicholas Paldino [.NET/C# MVP]

Peter,

No, macros are not supported in this manner. However, in VS.NET 2005,
the build system in VS.NET is MSBUILD, which is completely configurable, so
you could do something like this, if you wanted.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Steele said:
So I take it you cannot use macros like $(IntDir) in C# like you can in
VC++?

Nicholas Paldino said:
Peter,

In this case, you would just want to include the actual project in the
solution which contains the other project. This way, it will inherit all
of the project settings and you will run in the appropriate mode.

Otherwise, you will have to change the references each time, since you
won't be able to store the two dlls in the same directory.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Peter Steele said:
I've written a C# DLL that I want to include in my other C# projects.
What I want to do is include the Debug version of the DLL when I am
building the other apps in debug mode and Release version of the DLL
when I'm building in release mode. This is quite easy to do in VC++
using various macros that are available in the project file. I can't
seem to do the same thing when using a C# DLL in a C# project. Is there
a way to do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top