Which dinosaur survived the longest?

Although it is hard to determine for sure which dinosaur genus survived the longest time period while remaining the same, the title goes to Coelophysis which survived approximately 26.7 million years.

Coelophysis in recent decades, represents a genus of coelophysid theropod dinosaurs. These creatures inhabited the region that is now the southwestern United States, during the Late Triassic period, spanning from approximately 228 to 201.3 million years ago, across the Carnian to Rhaetian ages.