The mixed phase of extremely type-II layered superconductors in perpendicular magnetic field is studied theoretically via the layered XY model with uniform frustration. A partial duality analysis is carried out in the weak-coupling limit. It consistently accounts for both intra-layer (pancake) and inter-layer (Josephson) vortex excitations. The main conclusion reached is that dislocations of the two-dimensional (2D) vortex lattices within layers drive a unique second-order melting transition at high perpendicular fields between a low-temperature superconducting phase that displays a Josephson effect and a hightemperature "normal" phase that displays no Josephson effect. The former state is best described by weakly coupled 2D vortex lattices, while the latter state is best characterized by a decoupled vortex liquid. It is further argued on the basis of the duality analysis that the second-order melting transition converts itself into a first-order one as the perpendicular field is lowered and approaches the dimensional cross-over scale. The resulting critical endpoint potentially accounts for the same phenomenon that is observed in the mixed phase of clean high-temperature superconductors.