Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

NullReferenceException when conditionally calling UseGlimpse #102

Open
ddotlic opened this issue Jan 11, 2016 · 0 comments
Open

NullReferenceException when conditionally calling UseGlimpse #102

ddotlic opened this issue Jan 11, 2016 · 0 comments

Comments

@ddotlic
Copy link

ddotlic commented Jan 11, 2016

We're seeing something rather unexpected - if we call services.AddGlimpse() but then don't call app.UseGlimpse() - for example, because we're running in a production environment - the site crashes.

The error is it appears identical to the one observed in this bug: #98

Since the call to AddGlimpse() (made in ConfigureServices) cannot be avoided by an if in an easy manner (the criteria we use which is environment is not as easily available as it is in Configure method) I would expect it to not do much until one actually calls UseGlimpse()?

Or are we expected to "pair" the Add/Use by guarding both with the same conditional (up to us to see how to achieve this)?

Differently put I am not sure if this is a bug (personally expect that it is) or me missing something...

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

No branches or pull requests

1 participant