If you post a question about a problem you have, then find the solution to your own problem, please, please post it.
While official policy is to encourage self-answering questions, I personally take a dimmer view of people who post a question then answer their own question seconds later. If it's a common problem to which the user wants to document the solution, that can be a helpful contribution to the site, but frankly I hold such questions to a higher standard of "it better be a good general question."
In general, SE question serve two purposes: they help the OP get the information they need, and they create a searchable archive of useful information for people who encounter the problem in the future. If a question seems likely to only fill the first role, it gets closed as "too localized." But an instantly self-answered question only fills the second role, so it had better be good at that second role (i.e. it should be something that others are likely to look for).
If someone asks and then instantly answers their own question, my first response is to ask "what's the point?" Sometimes there is indeed a good point in documenting the question, but if there isn't, I'm likely to vote against the question.