Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Knowing DLL Debug/release

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kishor - 11 Jul 2006 11:04 GMT
Hi,
I am loading DLL dynamically. I have no issues with that.
I have one small problem. How do I know dll is compiled in Debug/Realse mode
? I want to load only a release mode DLL.

Please let me know is this possible ?

Kishor
Damien - 11 Jul 2006 11:23 GMT
> Hi,
> I am loading DLL dynamically. I have no issues with that.
[quoted text clipped - 4 lines]
>
> Kishor

Once the assembly is loaded, can you use Reflection to look for the
DebuggableAttribute? Please note that I'm not sure that this is the
answer, just an idea. (If you don't want to have the code occupying
memory if it is a debug version, you'll have to create a second
AppDomain and load it there to do the inspection).

Damien
Steve B. - 11 Jul 2006 13:05 GMT
DEBUG and RELEASE are only configuration options...
So the outputed assembly won't be marked as debug or release unless you find
a way to indicate it. Moreover, custom solution configuration are often a
good way to customize the dev process (adding new conditional attributes,
etc...) and then it is neither debug, neither realease.

I suggest you creating an assembly attribute class that can mark the
assembly as release, and then check if the assembly contains the correct
value.

Then, in your assemblyinfo.cs, you should add something like this :

#if DEBUG
[assembly: ReleaseState(ReleaseStates.Debug)]
#else
[assembly: ReleaseState(ReleaseStates.Released)]
#endif

When loading the assembly in the client app, just check if the assembly has
the correct attribute value.

HTH
Steve

> Hi,
> I am loading DLL dynamically. I have no issues with that.
[quoted text clipped - 5 lines]
>
> Kishor

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.