See the question and my original answer on StackOverflow

When you program with DirectX make sure you always enable the "debug layer" in dev and check the output in Visual Studio's "Output" window (or other debugger output).

Check these links: Using the debug layer to debug apps and Direct3D SDK Debug Layer Tricks for more on this as the way it can be installed has changed over DirectX version and years...

This will show you why it fails:

Alpha blended swapchains must be created with CreateSwapChainForComposition, or CreateSwapChainForCoreWindow with the DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER flag.