1

I get an error when upgrading the VS2015RC template to beta6 and all the dependencies in project.json to beta5.

Not sure if its related but had to remove app.UseBrowserLink(); from startup.cs to get it to compile. https://github.com/aspnet/Home/issues/719#issuecomment-118632892

I also renamed _globalimport to _viewimports, but tried both, no difference.

In startup.cs I can see the injection of the object.

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

But when the layout page has the following it errors

@inject IOptions<AppSettings> AppSettings

And the error below

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; }
William
  • 1,375
  • 12
  • 27
  • note that _GlobalImport.cshtml must be renamed to _ViewImports.cshtml in beta 5. It must be named exactly, note the change to plural "Imports". I only mention this because you did not spell them exactly right in your question. – Joe Audette Jul 07 '15 at 13:30
  • That must have been it because I tried both again and it works. Thanks! – William Jul 08 '15 at 00:27

0 Answers0