Wednesday, October 12, 2016

What is Load User Profile in IIS 8.5?



Specifies whether IIS loads the user profile for an application pool identity. When set to True, IIS loads the user profile for the application pool identity. Set to False when you require IIS 6.0 behavior.


This is great for application isolation.  It also can have an impact on your application if you are using Active Directory to manage application access.  The Windows Cryptographic Service Provider will try to store or load a key for your certificate in the user store, and this will require a profile to be available; otherwise, a cryptographic context error will occur.


Note that the Load User Profile setting only applies to user accounts. Service Accounts like NETWORK SERVICE and ApplicationPoolIdentity have special handling.


Source

http://stackoverflow.com/questions/17149132/what-exactly-happens-when-i-set-loaduserprofile-of-iis-pool


https://technet.microsoft.com/en-us/library/cc745955.aspx

What is IIS application pool Idle Timeout Action?

Starting in IIS 8.5, the application pool idle process capability was extended.  In prior versions, the worker process  had an idle timeout property.  When the idle timeout was configured, a worker process will shut down after a specified period of inactivity, by default 20 minutes. 


What happened when that boundary was hit was that the worker process was terminated.  The session would be terminated.  This killed the session and the user would be forced to start over.  This is an issue for a customer who tends to have long web sessions.


The idle process capability provides the ability to override the default terminate behavior.  The property is either terminate (default) or suspend.  A suspended worker process remains alive but is paged-out to disk, reducing the system resources it consumes. When a user accesses the site again, the worker process wakes up from suspension and is quickly available. When an idle worker process is terminated, the worker process is shut down and the startup period will be longer when the site is subsequently accessed. The default behavior is to terminate the idle worker process, and the same behavior is used in the previous versions of IIS.


Source:

https://www.youtube.com/watch?v=hkizFsHDexA
https://nimitsharma.wordpress.com/2014/10/03/introducing-iis-application-pool-idle-timeout-action/

Tuesday, October 4, 2016

MVC Razor Syntax: Can't implicitly convert bool? to bool

Problem:

My model had several variables which were nullable Booleans.  My issue was how to bind them in the Razor syntax without getting an error.


I had tried
@Html.CheckBoxFor(model=>(bool) model.LengthConfinementLife)


which will compile but fails on a runtime error.


Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

Solution:



@Html.CheckBox("LengthConfinementLife", Model.LengthConfinementLife?? false)
@Html.Label("LengthConfinementLife", "My Dates are Flexible")


Source:

http://stackoverflow.com/questions/6849774/mvc3-creating-checkbox-for-nullable-boolean