I have compiled bitcoin 0.4 under Visual Studio 2010. I know this isn't supported, but the bug isn't connected to Visual Studio.
In util.h there is this block of code:
inline uint160 Hash160(const std::vector<unsigned char>& vch)
{
uint256 hash1;
SHA256(&vch[0], vch.size(), (unsigned char*)&hash1);
uint160 hash2;
RIPEMD160((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2);
return hash2;
}
Now the problem is that if there isn't a wallet the function is called with an empty vch. In "debug" mode the &vch[0] asserts, because 0 is >= the size of the vector. Read for example http://stackoverflow.com/questions/2728255/c-getting-the-address-of-the-start-of-an-stdvector