Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4274338
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:50:00+00:00 2026-05-21T07:50:00+00:00

I created a library with many utility functions to perform some tasks and placed

  • 0

I created a library with many utility functions to perform some tasks and placed it in it’s own DLL.

Throughout the methods in this library, i’ve placed Debug.Assert statements to verify the state of the application.

The problem is, when the Assert is firing (the condition is false), it presents the dialog, clicking “Abort” on it causes the entire application that uses this DLL to crash.

This poses 2 questions:

  1. Can this be avoided? i’d expect this to throw an exception without exiting the application.

  2. How come a DLL can cause the application that loads it to exit? isn’t this a security breach?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:50:01+00:00Added an answer on May 21, 2026 at 7:50 am

    If you want to have an exception thrown, why dont you just throw an exception?

    Change

    Assert(var);
    

    to

    if(!var)
      throw new Exception("var was false");
    

    Assert will leave the application, assertion are here to protect you from coder’s mistake. If a function should never receive a null pointer, and if it does then it would be a mistake, then an assert would be the right tool.

    If you want to express an exceptionnal situation, than the exception is the tool you are looking for

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a 'Class Library' in C#, which has many functions with summary (XML
I created a library bundle for commons-lang3 and this works well. I can build
I have created a class library in VB .NET. Some code in the library
I have created a static library following this link . But I am facing
I created a .NET class library in C# with some resources for localization and
I am writing a library of utility classes, many of which are singletons. I
I'm writing a dll library in Delphi with multiple threads created by it. Let
There are many questions about this PersistenceException, but I have not seen some, where
Many library classes in AS3 have read only properties. Is it possible to create
I need to find/create a library that can load hdr images in many formats

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.