Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core Nancy使用.Net内核呈现嵌入式视图_Asp.net Core_Nancy_.net Core_Project.json - Fatal编程技术网

Asp.net core Nancy使用.Net内核呈现嵌入式视图

Asp.net core Nancy使用.Net内核呈现嵌入式视图,asp.net-core,nancy,.net-core,project.json,Asp.net Core,Nancy,.net Core,Project.json,我已经跳过了很多障碍,但我仍然看到南希默认的404图像。 我已经“掌握了”project.json,因此我可以使用project.json文件中的以下块嵌入我的资产(包括/assets/views/index.html): "buildOptions": { "embed": [ "assets/**", "Content/**", "fonts/**", "Scripts/bootstrap.js", "Scripts/jquery-2.2.2.j

我已经跳过了很多障碍,但我仍然看到南希默认的404图像。 我已经“掌握了”
project.json
,因此我可以使用
project.json
文件中的以下块嵌入我的资产(包括/assets/views/index.html):

 "buildOptions": {
  "embed": [
    "assets/**",
    "Content/**",
    "fonts/**",
    "Scripts/bootstrap.js",
    "Scripts/jquery-2.2.2.js",
    "Scripts/mustache.js",
    "favicon.ico"

    //, "Scripts/**" - include this and build fails with errors in *.targets (!)
  ]
}
这在调试和查询程序集资源时得到确认。一切都好

我的引导器包含:

        protected override void ConfigureApplicationContainer(TinyIoCContainer container)
    {
        DependencyResolver.ConfigureDependencies(container);
        ResourceViewLocationProvider
            .RootNamespaces
            .Add(GetAssembly(), "<name to assembly>");  //embedded resource directory location
    }

这不意味着什么。。。我会错过什么吗?在.Net Framework中运行良好

为什么您使用的是AsFile扩展名而不是AsHtml?为什么您使用的是AsFile扩展名而不是AsHtml?
    public class IndexModule : NancyModule
{
    public IndexModule() 
    {
        Get("/", args => Response.AsFile("assets/views/index.html", "text/html"));
    }
}