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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:04:02+00:00 2026-05-16T07:04:02+00:00

While debugging my Visual Studio 2010 MVC2 solution, I noticed something that I didn’t

  • 0

While debugging my Visual Studio 2010 MVC2 solution, I noticed something that I didn’t necessarily expect and that struck me as inefficient. When I was viewing the Home page, the IntelliTrace showed that many exceptions were getting thrown and caught while resolving a partial view.

I have code that calls the partial view like this:

<% Html.RenderPartial("FiltersAvailablePartialView", Model.AvailableFilters); %>

The structure of the views in the project follows a typical MVC application. There is a Views folder which contains two folders, Home and Shared. In the Home folder I have the .aspx page that is used as my main view page, and in the Shared folder I have a .ascx page that is used as a partial view, as shown below (with other views and partial views not listed for simplicity):

Views

   –>Home

        –>Home.aspx

   –>Shared

        –>FiltersAvailablePartialView.ascx

What I see in the IntelliTrace when I load the page is that these exceptions are thrown and caught:

Thrown: “The file ‘/MyApp/Views/Home/FiltersAvailablePartialView.aspx’ does not exist.”

Caught: “The file ‘/MyApp/Views/Home/FiltersAvailablePartialView.aspx’ does not exist.”

Thrown: “The file ‘/MyApp/Views/Home/FiltersAvailablePartialView.ascx’ does not exist.”

Caught: “The file ‘/MyApp/Views/Home/FiltersAvailablePartialView.ascx’ does not exist.”

Thrown: “The file ‘/MyApp/Views/Shared/FiltersAvailablePartialView.aspx’ does not exist.”

Caught: “The file ‘/MyApp/Views/Shared/FiltersAvailablePartialView.aspx’ does not exist.”

So it appears that the .Net framework is using expensive try/catch methods to resolve a view–looking first for a .aspx view in the Home folder, then for a .ascx view in the Home folder, then for a .aspx view in the Shared folder, then for a .ascx view in the Shared folder. So while it eventually finds the partial view and the page renders without any errors, this seems like an expensive way (catching exceptions) to find the view.

Is there something built-in with the MVC2 framework I could/should do to make it resolve this partial view reference on the first attempt and avoid these costly try/catch calls that are happening?

  • 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-16T07:04:03+00:00Added an answer on May 16, 2026 at 7:04 am

    If you compile in Release mode, this happens only once. If you compile in Debug mode, it happens for every request.

    Profiling in Debug mode is often of very limited relevance to real-world performance.

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

Sidebar

Related Questions

Are there any events that Visual Studio raises while debugging that I could subscribe
Is there any way to cause Visual Studio 2010 to break while debugging when
While debugging some C++ code using Visual Studio 2012 RC, I noticed a strange
i get this dialog while debugging code in visual studio 2008. (your step-into request
I've been getting an error recently while debugging an ASP.NET application in Visual Studio
While debugging a problem in a WPF application, I have noticed that the TwoWay
I'm debugging an application in Visual Studio 2010 going step by step and, astonishingly,
Visual Studio 2008/2010/ASP.NET: How to speed up the delay after rebuilding the solution? I
I ask because I couldn't find the stack trace in Visual Studio, while debugging
VB.NET program. While developing on Visual Studio Express 2010, there are two buttons: Start

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.