Dishwasher Door Gasket

I bought a new door gasket thinking it would be easy to install - i had been snapping the old one back in for awhile. The new one won’t stay in - is there supposed to be glue or something?