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 5987267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:47:25+00:00 2026-05-22T22:47:25+00:00

I have a MVC app that is loading a external DLL and when in

  • 0

I have a MVC app that is loading a external DLL and when in production I get no error at all. Firefox just says the connection was reset. So I put some try/catch in the code but they still do not work, I still get the connection reset message.

I know the error is a BadImageFormatException but why don’t I see anything in the browser?

 public class HomeController : Controller
    {

        [DllImport("CDCrypt.dll")]
        [return: MarshalAs(UnmanagedType.LPStr)]
        public static extern String Encrypt([MarshalAs(UnmanagedType.LPStr)] String aName);



        [DllImport("CDCrypt.dll")]
        [return: MarshalAs(UnmanagedType.LPStr)]
        public static extern String Decrypt([MarshalAs(UnmanagedType.LPStr)] String aName);


        //
        // GET: /Home/

        public ActionResult Index()
        {

            try
            {
                ViewBag.EncryptString = Encrypt("test");
            }
            catch (Exception e)
            {
                ViewBag.EncryptString = "Stack Trace\r\n:" + "\r\nException: " + e.Message;
                return new HttpStatusCodeResult(500);
            }
            return View();
        }

        public ActionResult Up()
        {
            ViewBag.Up = "You can see me";
            return View();
        }



    }
  • 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-22T22:47:25+00:00Added an answer on May 22, 2026 at 10:47 pm

    There seem to be some exceptions which are marked as unrecoverable and so cannot be caught. This question (well this answer really) has a list of them, but I don’t know how exhaustive this is.

    This article has some more information about uncatchable exceptions, and how they can be caught if you throw them but not if the runtime throws them.

    This question says that doing a catch rather than a catch(Exception ex) will allow COM exceptions to be caught as well. Don’t know if this will help (I doubt it) but is interesting, and might.

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

Sidebar

Related Questions

I have asp.net mvc app that shows varios events. All events stored in a
I have an ASP.NET MVC app that stores all SQL DateTime in UTC, so
I have an MVC app that does a lot of work with jQuery ajax
I have an ASP.NET MVC app that opens a Request view in a new
I have an asp.net mvc app that is built to run as standard web
Assume I have an ASP.NET MVC app that's not doing anything too fancy (no
So, I have an asp.net mvc app that is being worked on by multiple
I have a MVC app and using JQuery. I have anchor that I setup
I have an asp.net mvc app running on a local iis website that is
So I have about 10 short css files that I use with mvc app.

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.