1

将 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; }
4

0 回答 0