Queria saber se posso utilizar " ever " no simple past ou apenas no past perfect tense ?

Hi everybody , I have a question about the use of " ever " I've seen on the internet the following sentence ( Did you ever visit Paris when you lived in France ? Past simple and other this way ( Have you ever visit Paris when you lived in France ? Past perfect tense . So can we use " ever " in both case ? Or is there some of them incorrect ? I will be waiting for an answer and Thank you so much !!

Aprenda hoje

Everything comes to him who waits
Quem espera sempre alcança