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 an ASP MVC app that uses it's own custom authentication mechanism. However
I have this ASP.NET MVC app that I've deployed on IIS6/Win2003 as a virtual
I have an ASP.NET MVC 2 app that uses URLS such as: /rsvp/33c4cf68-a2fe-4c0f-9834-08838e0532c3 /rsvp/4f28dad7-b05c-4887-818f-b4ae664b7192
I'm looking to create a solution for a asp.net mvc app that displays unstructured
In my ASP.NET MVC app, I have an interface which acts as the template
I think I'm missing something simple, but I'm just not seeing it. I have
My application I have an application design that looks like this: web application layer
I have a Windows Service that retrieves messages from a RabbitMQ queue. The service
Despite the plethora of URL routing posts, I have yet to reach enlightenment on
Here is my problem for using mvc2, I cant find a silver bullet fix

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.