Almost certainly it's because your camera is trying to autofocus and can't, so it locks the shutter. Mine does that (Canon 550D). The settings you want are - lens as wide open as it will go, 800 iso (higher than 800 and you're liable to get unacceptable long exposure noise, although some cameras handle it better than others), exposure length will then be for you to experiment with and will depend on iso and aperture. With a 18-135mm lens wide open at 800 iso I'll start seeing stars at around 10 secs. If the Moon is visible you can use it to autofocus, then switch the lens to manual without moving anything. If the Moon's not around you can sometimes use the most distant bright object you can see but unless you're on a hill this doesn't really work. The other alternative is to focus on a distant object in daylight, switch to manual focus and tape the focus ring so you can't accidentally move it. With a really long lens there are other methods but I'm guessing you're not using a really long lens. Lenses generally focus 'past' infinity - I think a/f lenses do it so they can actually find infinity focus. You will need the camera well locked down on a good tripod and use a cable or remote release.