Debug Error 500 – IIS

1. ​Howto force error 500 to enable testing the error output and logging: Navigate to site root or a page with ?someParam=<script> (note: this will be treated a a dangerour script and error 500 thrown). 2. MVC Web.config <httpErrors errorMode=”Custom” existingResponse=”Auto”>       <remove statusCode=”404″ />       <error statusCode=”404″ path=”/404.html” responseMode=”ExecuteURL” /> […]

Shim Shiv Polyfill

Shim=Shiv (latest http://cdnjs.com/libraries/html5shiv) Kind of like polyfills cover over the differences in implementations of features. The way the HTML5 shiv works requires you to put it in the <head> element Also refer to excellent reference on Html5 polyfilling https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills​​

Powershell Basics

​Powershell – scripting language. Fileext = .ps1 Tools: Powershell Console and ISE (intellisense capable, tabbed navi, testing scripts etc) Cmdlets = name for Powershell commands (Get-Command etc..) installed as part of WMF (WM4 is latest, WM5 is preview). Commands avl may vary by OS, Test-NetConection not avl in Win7, only Win8 and above. Cmdlets and parameters have aliases like […]

Deployment Publishing and Continuous Integration

Fake (F# based) or PSake ​(powershell based) or Cake (C# based) Deployment and CI.. Other alternatives: TeamCity, Jenkins, Octopus, AppWare, TFS Builds DB publishing: DacFx (Dacpac approach) http://www.iis.net/learn/publish/using-web-deploy/dbdacfx-provider-for-incremental-database-publishing DbSqlPackage Provider (soon to be deprecated) ​https://msdn.microsoft.com/en-us/library/hh550081%28v=vs.103%29.aspx ​​​SqlPackage tool: https://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx DB Lifecycle Management (Key/Root Article) https://msdn.microsoft.com/en-us/library/jj907294.aspx

Standards Best Practices and Samples

https://www.roberthalf.com/technology/blog/4-best-practices-for-microsoft-net-framework-and-applications ​​​http://jasonwatmore.com/archive.aspx​ ​http://webdevchecklist.com​/ http://www.developerfusion.com/article/8307/aspnet-patterns-every-developer-should-know/​ ​​Business transactions: http://stackoverflow.com/questions/19548531/unit-of-work-repository-pattern-the-fall-of-the-business-transaction-concept

Identity Server, Claims, Tokens, Idp, Rp, STS, Saml, OpenId, OAuth, Bearer Token, SSO

Identity Server3 – Getting Started with Step wise Code Samples ​https://identityserver.github.io/Documentation/docsv2/overview/mvcGettingStarted.html Using an ACS (Access Control Service/Namespace) for Claims based Federation https://blog.kloud.com.au/2014/06/06/claims-based-federation-service-using-microsoft-azure/ Using OWIN and Azure Ad to Secure MVC and Web Api http://www.cloudidentity.com/blog/2014/04/28/use-owin-azure-ad-to-secure-both-mvc-ux-and-web-api-in-the-same-project/ Adding minimal OWIN auth to an existing MVC WebApp http://weblog.west-wind.com/posts/2015/Apr/29/Adding-minimal-OWIN-Identity-Authentication-to-an-Existing-ASPNET-MVC-Application#MinimalCodeSummary OWIN OpenID Connect Middleware Flow Explained (and EBook) https://www.microsoftpressstore.com/articles/article.aspx?p=2473126 ​Azure Active […]

Query Performance

Measurement of sproc query performance: =========================================== ## Tools to use: =============== – Include actual query plan in ssms – Look for NCI/CI Index scan – Look for Key Lookups – Use Index usage stats to figure out which index is being used.. – Make covering indexes based to reduce Key Lookups..(Select or where clauses go […]

Design Pattern Snippets

## Singleton: A singleton stores common data in only one place. public sealed class SiteStructure { object[] _data = new object[10]; static readonly SiteStructure _instance = new SiteStructure(); public static SiteStructure Instance { get { return _instance; } } private SiteStructure() { // Initialize members here. } } =================== Best Practice: Use Lazy<T> to init […]