NHaml config issue: model not found

I have a little problem with my NHaml config:

<configSections>
    <section name="nhaml" type="NHaml.Configuration.NHamlConfigurationSection, NHaml"/>
</configSections>

<nhaml AutoRecompile="true">
  <assemblies>
    <add assembly="Microsoft.Web.Mvc"/>
    <add assembly="MyAssembly"/>
  </assemblies>
  <namespaces>
    <add namespace="NHaml.Web.Mvc"/>
    <add namespace="MyAssembly.Models"/>
    <add namespace="System.Linq"/>
  </namespaces>
</nhaml>

      

The problem is I am trying to use a model from MyAssembly.Models in my opinion:

%ul
  - foreach(var v in (IQueryable<Model>)ViewData["stat"])
    %li= v.name

      

But it keeps crashing, informing me that MyAssembly.Models.Model is not recognized and asking if I am missing a usage directive. Is there something wrong in my web.config or my view?

Thanks in advance.

0


source to share


1 answer


I didn't use NHaml as it was part of MvcContrib, but back then I had my own models that gave the full assembly name in config, like this:



MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

      

+2


source







All Articles