The problem in my case was that in order to catch another exception I had enabled common language runtime (CLR) exceptions. And I forgot to disable it.
I disabled it in my exception setting. and it overlooked this exception and went on to run and create a db for me (in my case) automatically.