I'm building a Nancy app on OS X and trying to use Razor templates. When Nancy tries to load a simple Razor template that just contains "Hello World", I get this error:

Error compiling template: views/index.cshtml

Errors:
[CS0006] Line: 0 Column: 0 - Metadata file `/Users/michael/Code/data-0x7faa515d7a00' could not be found (show)

Details:
hello world

Compilation Source:
// ------------------------------------------------------------------------------
Line 1: //  <autogenerated>
Line 2: //      This code was generated by a tool.
Line 3: //      Mono Runtime Version: 4.0.30319.17020
Line 4: // 
Line 5: //      Changes to this file may cause incorrect behavior and will be lost if 
Line 6: //      the code is regenerated.
Line 7: //  </autogenerated>
Line 8: // ------------------------------------------------------------------------------
Line 9: 
Line 10:    namespace RazorOutput {
Line 11:        using Microsoft.CSharp.RuntimeBinder;
Line 12:        using System;
Line 13:        using System.IO;
Line 14:        
Line 15:        
Line 16:        public class RazorView : Nancy.ViewEngines.Razor.NancyRazorViewBase {
Line 17:            
Line 18:    #line hidden
Line 19:            
Line 20:            public RazorView() {
Line 21:            }
Line 22:            
Line 23:            public override void Execute() {
Line 24:    WriteLiteral("hello world\n");
Line 25:    
Line 26:            }
Line 27:        }
Line 28:    }
Line 29:    

The project is in /Users/michael/Code/nancy-hello-world, but the error says Metadata file '/Users/michael/Code/data-0x7faa515d7a00', so I'm wondering if maybe this is a path problem?

I tried running the app on Windows (also using dnx) and it works fine.

You can clone the app from https://github.com/michaelrkn/nancy-hello-world.

Related posts

Recent Viewed