This operation requires a connection to the 'master' database
I had this issue and in my case resolved it by adding "Integrated Security=True" to the connection string. This only applies if you're connecting to the DB using Windows Authentication. Hope it helps.
Try setting Persist Security Info = True
in your connection string.
Hope this helps.