将VS2015RC MVC模板升级到beta5依赖项

时间:2015-07-05 22:57:51

标签: asp.net-core-mvc dnx dnvm

将VS2015RC模板升级到beta6并将project.json中的所有依赖项升级到beta5时出错。

不确定是否相关但必须删除app.UseBrowserLink();从startup.cs开始编译。 https://github.com/aspnet/Home/issues/719#issuecomment-118632892

我还将_globalimport重命名为_viewimports,但尝试了两者,没有区别。

在startup.cs中,我可以看到对象的注入。

IConfiguration config = Configuration.GetConfigurationSection("AppSettings");
services.Configure<AppSettings>(config);

但是当布局页面出现以下错误时

@inject IOptions<AppSettings> AppSettings

以下错误

An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.

    #line hidden
    public ASPV__Views_Shared__Layout_cshtml()
    {

    }
    #line hidden

    [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
    public IOptions&lt;AppSettings&gt; AppSettings { get; private set; }
    [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
    public Microsoft.AspNet.Mvc.Rendering.IHtmlHelper&lt;dynamic&gt; Html { get; private set; }
    [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
    public Microsoft.AspNet.Mvc.Rendering.IJsonHelper Json { get; private set; }
    [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute]
    public Microsoft.AspNet.Mvc.IViewComponentHelper Component { get; private set; }

0 个答案:

没有答案