Friday, September 06, 2013

Windows Identity Framework Signing out

When using claims based security and you implement the sign out functionality do not forget to delete the sessions cookie... otherwise when playing around with the back button you are able to sign in again... this is something you don't want...

Loading ....

Monday, June 17, 2013

MVC: Intellisense for custom HtmlHelpers or if you want to avoid @using to import namespaces

If you write custom HtmlHelpers its quite tedious to have to add @using on top of each page. To be able to use your newly written htmlhelpers

to avoid this just find the web.config in your views folder and locate the following section:
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization"/>
                <add namespace="System.Web.Routing" />
                <add namespace="SharpSolutions..MvcApplication.Helpers.BootStrap"/>
                <add namespace="SharpSolutions.MvcApplication.Helpers"/>

and add your custom namespace to it.

After you have done this reload your mvc project (or close Visual Studio and reopen it).

Tuesday, June 11, 2013

Windows Azure Logging not working Trace.TraceError throws: Not running in a hosted service or the Development Fabric.

I had the following line in my web.config:

    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
     <filter type="" />

After removing this: it created WAWSAppLogTable as expected.
More info can be found here:

for local debugging I left the line untouched... I created a new config transformation where I added:

    <add name="AzureDiagnostics" xdt:Locator="Match(name)" xdt:Transform="Remove" />

Which is quite logic since Azure websites is not hosted in the AppFabrik

Friday, June 07, 2013

Team Foundation 2012: Run xUnit unit tests

Currently I am using and writing my unit tests with xUnit. To enable this follow the steps outlined on MSDN.

You can find the binaries in the packages folder in your solution directory