Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Options do not work on .NET Core in ASP.NET 5 Web template #54

Closed
rustd opened this issue Apr 9, 2015 · 8 comments
Closed

Options do not work on .NET Core in ASP.NET 5 Web template #54

rustd opened this issue Apr 9, 2015 · 8 comments
Milestone

Comments

@rustd
Copy link

rustd commented Apr 9, 2015

  • Create ASP.NET Website template
  • Switch to Core CLR
  • Run it

The application name is not being set. SiteTitle is being read from config using options model.
In startup we have

services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));

In _Layout we have

@inject IOptions<AppSettings> AppSettings
    <title>@ViewBag.Title - @AppSettings.Options.SiteTitle</title>
@rustd rustd added this to the 1.0.0-beta4 milestone Apr 9, 2015
@rustd
Copy link
Author

rustd commented Apr 9, 2015

@danroth27 @Eilon @muratg Beta4 bug

@rustd
Copy link
Author

rustd commented Apr 9, 2015

I think the root cause is GetSubKey is returning null on CoreCLR

1 similar comment
@rustd
Copy link
Author

rustd commented Apr 9, 2015

I think the root cause is GetSubKey is returning null on CoreCLR

@Eilon Eilon removed this from the 1.0.0-beta4 milestone Apr 10, 2015
@Eilon
Copy link
Member

Eilon commented Apr 10, 2015

Not beta4.

@muratg
Copy link

muratg commented Apr 13, 2015

We need to fix the Options bug (not sure exactly what the root cause is though.) We also should update the template not to use Options for storing site title.

@muratg muratg added this to the 1.0.0-beta5 milestone Apr 13, 2015
@muratg muratg added the bug label Apr 13, 2015
@ppanyukov
Copy link

For what it's worth, I had exactly same problem, and then it somehow gone away. I did this:

  • I fiddled around with project.json
  • this triggered package restore
  • I reverted any changes to project.json
  • another package restore
  • after this the problem is gone.

Very strange. Possibly some broken cached version of some package somewhere there?

My project.json uses -beta4 postfixes for everything, as on out-of-the box template for MVC 6 project.

EDIT:

  • running the same thing in IIS Express worked from the beginning.

@regisbsb
Copy link

@rustd the whole file is condition compiled out of DNX core....
It has been fixed in a871225 . It would be nice have a look at the issues in github before checkin so you can reference then and close then as appropriate. I've spent the whole day trying to debug and help with a pull request to find out that it was fixed in the dev branch by @HaoK. Normally at work I always check the working items before I commit...

@danroth27
Copy link
Member

Duplicate of #35

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants