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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:30:07+00:00 2026-05-26T02:30:07+00:00

I am only using RazorViewEngine on one of my ASP.NET MVC 3 applications and

  • 0

I am only using RazorViewEngine on one of my ASP.NET MVC 3 applications and I cleared Web Forms view engine out with following code inside Application_Start method of my Global.asax.cs file

ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new RazorViewEngine());

I decided to see something solid so that I could be satisfied with this two-line-code-effort and I try to render a partial view which does not exist and I got this result :

The partial view ‘_ResortMapPartialView’ was not found or no view
engine supports the searched locations. The following locations were
searched:
~/Areas/Accommodation/Views/resort/_ResortMapPartialView.cshtml
~/Areas/Accommodation/Views/resort/_ResortMapPartialView.vbhtml
~/Areas/Accommodation/Views/Shared/_ResortMapPartialView.cshtml
~/Areas/Accommodation/Views/Shared/_ResortMapPartialView.vbhtml
~/Views/resort/_ResortMapPartialView.cshtml
~/Views/resort/_ResortMapPartialView.vbhtml
~/Views/Shared/_ResortMapPartialView.cshtml
~/Views/Shared/_ResortMapPartialView.vbhtml

It looks a little better. Now it looks for less items than before. But still the files with .vbhtml extensions are making me unconformable.

The question is that : How can we get rid of them?

  • 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-26T02:30:07+00:00Added an answer on May 26, 2026 at 2:30 am

    My suggestion would be to override the RazorViewEngine definitions for the following to only include cshtml files.

    • AreaViewLocationFormats
    • AreaMasterLocationFormats
    • AreaPartialViewLocationFormats
    • ViewLocationFormats
    • MasterLocationFormats
    • PartialViewLocationFormats
    • FileExtensions

    An brief example:

    public class CSHtmlViewEngine: RazorViewEngine
    {
        public CSHtmlViewEngine()
        {
            base.AreaViewLocationFormats=
                new string[]
                    {
                        "~/Views/{1}/{0}.cshtml",
                        "~/Views/Shared/{0}.cshtml"
                    };
    
            base.AreaPartialViewLocationFormats =
                new string[]
                    {
                        "~/Areas/{2}/Views/{1}/{0}.cshtml",
                        "~/Areas/{2}/Views/Shared/{0}.cshtml",
                    };
    
       // All the other LocationFormats listed above will also need to be amended
       // Don't forget the FileExtensions array
       }
    

    }

    See my answer which talks about overriding these values. The same principle applies. You will need to register this modified ViewEngine (CSHtmlViewEngine) in the ApplicationStart method

    ViewEngines.Engines.Clear();
    ViewEngines.Engines.Add(new CSHtmlViewEngine());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP based web application which is currently only using one webserver
I am working with Spring MVC 2.5. Oftentimes, I am only using one form
Im very new to IIS and ASP.NET. Im only using it as a script
I have one page website only using HTML, CSS and JavaScript. I want to
We typically only reference Microsoft.Practices.Unity.dll in our applications. We're only using basic capabilities, and
On one site, I'm only using a single level Masterpage and in a page
I am making a simple web browser in Scala 2.9. This is only using
How would I write this so I'm only using one echo? echo <div class='post'>;
i'm trying to make a web only using couchdb and couchapp... but for some
I am currently developing an application with the intention of only using chrome, one

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.