Open 8 opened 8 years ago
I wonder if we could use this https://github.com/NancyFx/Nancy/blob/feb8a122d8173eafde87bbd650faa2b04429131a/src/Nancy/DefaultRuntimeEnvironmentInformation.cs#L27 in the ViewConfiguration.Default
?
If I recall, the DefaultViewConfigurationProvider used to have the behavior of using the IRuntimeEnvironmentInformation
but we changed it before we merged the pull-request. I cannot remember why we removed it, but I do know that the IRuntimeEnvironmentInformation
interface was discussed in the CoreCLR context because we could no longer check the attributes.
Maybe we could update the DefaultViewConfigurationProvider
to make use of #if DEBUG
instead. The problem with that is that it would only function inside the debugger (I think) and not when you build and deploy your site in debug mode.
ping @NancyFx/most-valued-minions
Actually #if DEBUG
would be fine for the DefaultViewConfigurationProvider
. If you care either way about the behavior then you would explicitly set it and user set values always take precedence over what the default provider configures
Bingo
On Wednesday, 27 April 2016, Andreas Håkansson notifications@github.com wrote:
Actually #if DEBUG would be fine for the DefaultViewConfigurationProvider. If you care either way about the behavior then you would explicitly set it and user set values always take precedence over what the default provider configures
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/NancyFx/Nancy/issues/2432#issuecomment-215189437
Creating a custom ViewConfigurationProvider
with return new ViewConfiguration(true,true);
does not work (even though it is being hit if i set a breakpoint). Overriding Configure
in bootstrapper and calling environment.Views(runtimeViewUpdates: true);
fixes this problem.
2.0-b
Prerequisites
DEBUG
andRELEASE
modeDescription
In nancy 2.0.0-alpha caching razor views is not disabled by default anymore as it used to be in debug mode.
Steps to Reproduce
System Configuration
Workaround:
Configure nancy yourself to disable the cache in debug mode, for example:
Take care, Martin