tag:blogger.com,1999:blog-4063545436138319205.post8292521666629178275..comments2024-03-29T06:16:42.170-07:00Comments on Tom DuPont .NET: Control Minification per Request with Web OptimizationsTom DuPonthttp://www.blogger.com/profile/08233783264428691459noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4063545436138319205.post-31622525978383788092013-09-10T22:16:46.461-07:002013-09-10T22:16:46.461-07:00The AssetManager.OptimizationEnabled property does...The AssetManager.OptimizationEnabled property does not seem to be dependent on Session, so I am not sure why it would throw inside of there. However, if you are saying it is throwing anywhere else I would suggest just adding null checks or removing the session code all together; my use of session is just for convenience.<br /><br />FYI, here is the OptimizationEnabled code that I pull from JetBrains dotPeek:<br /><br /> internal bool OptimizationEnabled<br /> {<br /> get<br /> {<br /> if (this._optimizationEnabled.HasValue)<br /> return this._optimizationEnabled.Value;<br /> else<br /> return BundleTable.EnableOptimizations;<br /> }<br /> set<br /> {<br /> this._optimizationEnabled = new bool?(value);<br /> }<br /> }Tom DuPonthttps://www.blogger.com/profile/08233783264428691459noreply@blogger.comtag:blogger.com,1999:blog-4063545436138319205.post-79599988299497391722013-09-09T03:45:57.999-07:002013-09-09T03:45:57.999-07:00Great post!
But i'm getting an exception when...Great post! <br />But i'm getting an exception when calling TrySetOptimizationEnabled,<br />because my session is null.<br /><br />Any Idea what it might be?<br /><br />thnx.Anonymoushttps://www.blogger.com/profile/12885350457310453834noreply@blogger.com