2

I am working on MVC application which has many views. Some of them are working fine.

And another view gives me an error: An error occurred while processing your request.

An application was working fine before nothing has changed recently and suddenly it has started showing the above error.

In my web.config,

  <customErrors mode="On" />

View output is,

 <div id="page-wrapper">
        <p align="right"><b>Welcome,</b></p>
Error. An error occurred while processing your request.
        <hr />
        <footer>
            <p>&copy; 2018 -</p>
        </footer>
    </div>
    <!-- /#page-wrapper -->
</div>

In It should load the respective view by calling controller action

   public ActionResult Test(String Organisation = "", String BusinessArea = "", String ApplicationName = "")
    {


        try
        {


            return View("~/Views/CompanyUsage/Test.cshtml", objLMT);

        }
        catch (Exception ex)
        {

           throw ex;
        }

    }

Below is the Test view,

I am not getting any clue why application behaving in such way. Kindly guide.

Update:

After changing i am getting below error

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

pankaj bawdane
  • 101
  • 4
  • 18
  • 2
    Try turning off custom error temporarily (with ``) to see actual exception message, and include it in your question. – Tetsuya Yamamoto Sep 06 '18 at 05:30
  • @TetsuyaYamamoto Done. I have updated my question with the actual exception message. – pankaj bawdane Sep 06 '18 at 05:47
  • Try running the application as administrator (on IIS) or running VS as administrator (on local dev machine). Related issues [here](https://stackoverflow.com/questions/9564420/the-source-was-not-found-but-some-or-all-event-logs-could-not-be-searched) and [here](https://stackoverflow.com/questions/20389248/the-source-was-not-found-but-some-or-all-event-logs-could-not-be-searched-inac/28219359). – Tetsuya Yamamoto Sep 06 '18 at 05:57
  • @TetsuyaYamamoto Application with same view working fine on Local machines. All the view – pankaj bawdane Sep 06 '18 at 06:02
  • Well, you can provide stack trace which can explain where the exception comes from, probably not just problem writing exception details to system event log. – Tetsuya Yamamoto Sep 06 '18 at 06:24

1 Answers1

1

Go To Your GoDaddy Plesk panel, Open Your Site Folder, One Web.config File And Place there Below Two Line code in web.confige file

<customErrors mode="Off" />
<trust level = "full" />

As Per your Question everything is right on local and you have to face an error after publish So try this, it may be work for you.

Aftab Lala
  • 136
  • 6