So I was in Vienna literally last week... I would not sweat the [perceived] dress code so much. I brought capris but honestly it was hot enough up until the end of the week that if I'd been wearing them, I would have been miserable. We certainly saw locals also wearing shorts tpp. We wore our shorts and tennis shoes to the restaurants we ate in and considering many of the other guests were wearing the same things, no one batted an eye. Let your husband wear his sneakers and if you wear shorts one day, it'll be just fine. Another example, we were in Salzburg on a day when it was 108 in Paris and 110 in Northern Germany and a measly 100 in Salzburg. You bet your butt we were wearing shorts and tank tops then.
Our one exception to the relatively casual dress in Vienna was eating at Steirereck in Stadtpark. It was recently ranked 17th in the world restaurant wise and yah, that was a true fine dining restaurant. We were in dresses and dressy sandals. Unless you're eating at something like that, I really wouldn't worry too much about it.