2

I'm running the MVC3 RC2 with Razor in my VB.NET application. I can't for the life of me figure out why I'm getting highlight errors in my markup.

Here are a couple of screenshots.

debug 1

debug 2

debug 3

1 Answer 1

2

Make sure you have the following in your Views\Web.config file:

<configSections>
  <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
  </sectionGroup>
</configSections>

<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>
Sign up to request clarification or add additional context in comments.

2 Comments

You appear to be correct. I was using the whitespace remover, and it looks like it buggered things up. <host factoryType="Omari.Web.Mvc.WhiteSpaceCleaningMvcWebRazorHostFactory, WhiteSpaceCleanerForWebFormsAndMVC3"/>
@ChaseFlorell Have you successfully combined "WhiteSpaceCleaner" with MVC3 without having such error? I have the same problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.