In 2005 , when Wilder refused to endorse Deeds against McDonnell in the race for attorney general , Deeds lost after a six-week recount by 360 votes out of nearly 2 million cast , the closest statewide race ever in Virginia .