我正在OS X上构建一个Nancy应用程序并尝试使用Razor模板。当Nancy尝试加载一个只包含“Hello World”的简单Razor模板时,我收到此错误:
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:
该项目位于/Users/michael/Code/nancy-hello-world
,但错误显示Metadata file '/Users/michael/Code/data-0x7faa515d7a00'
,所以我想知道这可能是路径问题吗?
我尝试在Windows上运行应用程序(也使用dnx),它运行正常。