Note that there are some explanatory texts on larger screens.

plurals
  1. POAssembly references in Nhaml
    primarykey
    data
    text
    <p>I'm trying to get Nhaml working for an ASP.NET MVC 2 project. The backend of the project is <a href="http://www.mongodb.org/" rel="nofollow noreferrer">Mongo DB</a>, using the <a href="http://normproject.org/" rel="nofollow noreferrer">NoRM driver</a>. NoRM specifies some custom types, particularly ObjectID as a reference to Mongo's unique _id column.</p> <p>I've got the Nhaml views compiling and outputting data from a strongly typed model, but it's choking on the ObjectID type written as such:</p> <pre><code>%td= Html.ActionLink("Update", "Update", new { id=Model._id }) </code></pre> <p>Specifically, the error message is:</p> <blockquote> <p><em>c:\Windows\Temp\a7lwemtp.0.cs(83,9) : error CS0012: The type 'Norm.ObjectId' is defined in an assembly that is not referenced. You must add a reference to assembly 'Norm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.</em></p> </blockquote> <p>...which seems fairly straightforward, except I still get the same error message after adding the Norm assembly reference to the Nhaml configuration part of my web.config file:</p> <pre><code>&lt;nhaml autoRecompile="true" templateCompiler="CSharp3" encodeHtml="false" useTabs="false" indentSize="2"&gt; &lt;assemblies&gt; &lt;add assembly="Norm" Version="1.0.0.0" Culture="neutral" PublicKeyToken="null"/&gt; &lt;add assembly="MyApp"/&gt; &lt;/assemblies&gt; &lt;namespaces&gt; &lt;add namespace="MyApp"/&gt; &lt;add namespace="MyApp.Controllers"/&gt; &lt;add namespace="MyApp.Models"/&gt; &lt;add namespace="Norm"/&gt; &lt;add namespace="Norm.BSON.DbTypes"/&gt; &lt;/namespaces&gt; &lt;/nhaml&gt; </code></pre> <p>I rather expected that to fix the problem. Am I missing something obvious, or completely misunderstanding the assembly reference that Nhaml is looking for?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload