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

  • Home
  • SEARCH
  • 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 3878788
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:39:08+00:00 2026-05-19T22:39:08+00:00

VS2010 Ultimate, ASP.NET MVC 3 w/Razor. I’ve created a custom view engine in my

  • 0

VS2010 Ultimate, ASP.NET MVC 3 w/Razor.

I’ve created a custom view engine in my MVC3 app that allows nested areas, like so

~/areas/admin
    /marketing
        /views
            index       
        /controllers
            marketingController
        /email
            /views
                index
                ...
            /controllers
                emailController
        /templates
            /views
                index
                edit
                ...                  
            /controllers
                templatesControler

etc.

This all works great, except for I seem to have lost intellisense in views that aren’t in the standard ~/areas/area_name/views/myview.cshtml location.

Any suggestions?

Update

Just on a lark, I added an @inherits statement

@inherits System.Web.Mvc.WebViewPage<Namespace.Models.Class>

and intellisense started working. I then deleted the statement, and it continues to work.

Is there some setting in the project file or something that tells Visual Studio what sort of intellisense to apply to an open file, other than the file extension? (If the extension was all that was used, I’d expect it to be a whole lot more consistent).

Update 2

While adding a web.config to each of my view folders fixes the problem quite nicely, putting the razor config in the root web.config doesn’t.

After adding the required system.web.webPages.razor section to ~/web.config,

  1. I add a Razor .cshtml view file to one of my nested view folders.
  2. Intellisense works.
  3. I rename the file (keeping the .cshtml extension)
  4. Intellesense and syntax highlighting stop working.
  5. I close the renamed file and reopen it – everything starts working again.
  6. Or, instead of closing and reopening the file, I rename it back to its original name, it starts working again.

This feels like a VS bug – renaming a file (but keeping the proper extension) shouldn’t, as far as I can tell, cause this sort of behavior. I’ll continue putting individual web.configs in each of my view folders since it corrects the problem, but it’s annoying to have to clutter up the solution when I’d expect these settings to propagate through the solution tree as other web.config settings do.

It’s also worth noting that, no matter where the Razor config is located, the site continues to function correctly whether or not intellesense is working.

Solved

I was informed (incredibly quickly) by the Powers That Be that this was a known issue that is corrected in MVC3 RTM and VS2010 SP1. The issue disappeared after updating my MVC3 installation and adding SP1.

  • 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-19T22:39:08+00:00Added an answer on May 19, 2026 at 10:39 pm

    The Views folder contains a Web.config file that sets default options for Razor views, including the default base type and namespaces, as well as a custom host that enables the @model directive.

    Razor views in a different folder won’t inherit this configuration.
    You need to add this configuration to a Web.config in your folder:

    <system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
            <namespaces>
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Routing" />
            </namespaces>
        </pages>
    </system.web.webPages.razor>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use VS 2010 Ultimate. I created an 'asp.net web application' from scratch, added
ASP.NET MVC2, framework 3.5 Machine 1: dev box - Win7 Ultimate x64(IIS 7.5), VS2010
ASP.NET 4.0: My laptop is running 64-bit Win7 Ultimate, using VS 2010 and IIS7.
I have vs2010 ultimate installed and sql server 2008 developer. I created a package
I just installed the beta for VS2010 Ultimate and I cannot locate the ADO.NET
I have this code written in .NET 4.0 using VS2010 Ultimate Beta 2: smtpClient.Send(mailMsg);
I'm working on a VS2010 Solution containing an ASP.NET Website Project and 8 c#
I've worked with ASP.NET once before and had a project where it was potentially
I'm using VS2010 Ultimate. Having code: //file IntSet.h #include stdafx.h #pragma once /*Class representing
I'm currently using the beta2 versions VS2010 Ultimate and TFS. I want to upgrade

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.