July 2013

Windows store privacy statement

I got the error from Microsoft while I was submit the app. The error is, “The app has declared access to network capabilities and no privacy statement was provided in the Windows Settings Charm.”

The sad part is that this is so easy to fix. First you will need to create a new directory Privacy and Page Control under it Privacy, it lives my pages/ directory. The page control Privacy creates the privacy.html, privacy.js and privacy.css files under Privacy folder.

My Privacy.Html Code is here

http://www.codeproject.com/Articles/292336/Silverlight-A-Beginners-Guide-for-Advanced-Develop<!DOCTYPE html>
    <meta charset="utf-8" />

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.1.0/js/base.js"></script>
    <script src="//Microsoft.WinJS.1.0/js/ui.js"></script>

    <link href="privacy.css" rel="stylesheet" />
    <script src="privacy.js"></script>
    <div data-win-control="WinJS.UI.SettingsFlyout"
        data-win-options="{settingsCommandId:'privacyPolicy', width:'narrow'}">

        <div class="win-ui-dark win-header">
            <button type="button" onclick="WinJS.UI.SettingsFlyout.show()" class="win-backbutton"></button>
            <div class="win-label">Privacy Policy</div>
        <div class="win-content">
                This application does not collect any information about users. This
application also does not collect any username or password that users enter to authenticate.
            <p>This privacy policy is subject to change without notice and was last updated on 22-July-2013. If you have any questions feel free to contact us directly at <a href="mailto:sales@eplannerpro.com">sales@eplannerpro.com</a>.</p>

Now you just need a quick way to add this to your app. Add the following code in your default.js file:

 app.onsettings = function (args) {

        args.detail.applicationcommands = {
            "privacyPolicy": {
                title: "Privacy Policy", href: "/Pages/Privacy/privacy.html"

Now, run the app. Go to setting pane, click on Privacy, you will show the privacy statement.

How to add reference System.Web.Optimization

The Microsoft.Web.Optimization package is now obsolete. With the final release of ASP.NET (MVC) 4 you should install the Microsoft ASP.NET Web Optimization Framework:

Install the package from nuget:

Right click on References, Select Manage Nuget Packages. Type Microsoft.AspNet.Web.Optimization in search box and press enter you will get the package. Click on install.

Create and configure bundle(s) in App_Start\BundleConfig.cs:

public class BundleConfig
    public static void RegisterBundles(BundleCollection bundles) {
        bundles.Add(new ScriptBundle("~/Scripts/jquery").Include(

        bundles.Add(new ScriptBundle("~/Scripts/knockout").Include(

Call the RegisterBundles() function from Application_Start() in your global.asax.cs:

using System.Web.Optimization;

protected void Application_Start() {

In your view.cshtml include the Optimization namespace and render the bundle(s):

@using System.Web.Optimization


HTTP Error 405.0 – Method Not Allowed error while trying to make a DELETE request to a .ashx

Here’s the final web.config section. The thing I needed to add I was missing was changing the staticFileHandler from using “all verbs” to all of them spelled out.

 <?xml version="1.0" encoding="utf-8"?>
    <add key="StorageRoot" value="C:\temp\"/>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime maxRequestLength="2147480000" executionTimeout="3600"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
      <remove name="WebDAVModule" />
    <handlers accessPolicy="Read, Write, Execute, Script">
      <remove name="StaticFile" />
      <remove name="SimpleHandlerFactory-ISAPI-2.0" />
      <remove name="WebDAV" />
      <remove name="SimpleHandlerFactory-Integrated-4.0" />
      <remove name="SimpleHandlerFactory-Integrated" />
      <add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Write" preCondition="integratedMode" />
      <add name="SimpleHandlerFactory-Integrated-4.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Write" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="SimpleHandlerFactory-ISAPI-2.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
      <add name="StaticFile" path="*" verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
        <requestLimits maxAllowedContentLength="2147480000"/>
        <remove users="*" roles="" verbs="" />
        <add accessType="Allow" users="*" verbs="GET,HEAD,POST,PUT,DELETE,DEBUG" />
        <remove path="*" />
        <add path="*">
            <add provider="ASP" verbosity="Verbose" />
            <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
            <add provider="ISAPI Extension" verbosity="Verbose" />
            <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI" verbosity="Verbose" />
          <failureDefinitions statusCodes="405" />

Page not found 404 error in IIS 7 when uploading big file size

I struggled with one issue for hours, before realizing that IIS7 was the culprit. Even though maxrequestlength was set to 1GB in httpclientrequest (web.config) and executiontimeout was set to 600 seconds, for a larger file it would keep failing. Firebug was throwing a “404 not found” error for the handler.ashx!

IS has a security feature called requestFiltering, which is to prevent denial of service attacks. It sets the file size to 30MB maximum by default.
To change it, add the following to youor system.webServer section of web.config

        <requestLimits maxAllowedContentLength="2147480000"/>

Here maxAllowedContentLength is set to 2 GB approx.

How To: Delete a Team Project from your Team Foundation Service collection

To delete a team project from your Team Foundation Service collection you will need Visual Studio 2012 (or just Team Explorer 2012, which is free here). These provide you with the “tfsdeleteproject.exe” command line tool, which is usually located in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE. Open a Command Prompt in that folder and then run the delete command like this (don’t forget the “/DefaultCollection” bit and remember to use quotation marks around your team project name if it has spaces in it).

tfsdeleteproject.exe /force /collection:https://.VisualStudio.com/DefaultCollection “My project name with spaces”