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

Exception when UserIdSecrets isn't turned on in the project file #60

Closed
davidfowl opened this issue Apr 26, 2017 · 7 comments
Closed

Exception when UserIdSecrets isn't turned on in the project file #60

davidfowl opened this issue Apr 26, 2017 · 7 comments
Assignees

Comments

@davidfowl
Copy link
Member

I created a 1.1.1 template and upgraded to 2.0 and used the new API the got this error:

image

It's pretty awful that this throws like that by default. Is there any way to avoid this exception and have it noop (like the other config providers do) if the application isn't configured for user secrets?

/cc @natemcmaster

@natemcmaster
Copy link
Contributor

What is in the template? IMO if template calls user secrets in C#, it should also scaffold the property in csproj.

@davidfowl
Copy link
Member Author

/cc @DamianEdwards I think this needs to be fixed for preview1.

@DamianEdwards
Copy link
Member

The new templates do, but the old empty template didn't, which is why you're seeing this. Are you thinking we just change this to log a warning instead of throwing?

@natemcmaster
Copy link
Contributor

There is no logging available from ConfigurationBuilder

@davidfowl
Copy link
Member Author

The new templates do, but the old empty template didn't, which is why you're seeing this. Are you thinking we just change this to log a warning instead of throwing?

I'm thinking it should n00p completely and not add the configuration provider. Just like the other configuration providers do.

@DamianEdwards
Copy link
Member

Ok so add an bool optional param overload then, and leave default as false, and set to true in WebHost

@natemcmaster
Copy link
Contributor

Fixed in #64

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

3 participants