In this paper, we report on the fabrication of optical nanoresonators using block copolymer lithography. The nanostructured gratings or nanofins were fabricated using a silicon-containing block copolymer on a chromium coated silicon-on-insulator substrate. The etch resistance of the block copolymer template enables a unique patterning technique for high-aspect-ratio silicon nanofins. Integration of the directed self-assembly with nanoimprint lithography provides a well-aligned array of nanofins with a depth of ∼125 nm on a wafer scale. The developed nanopatterning method is an alternative to the previously reported nanopatterning techniques utilizing block copolymers. A dense array of sub-10 nm nanofins is used to realize a photonic guided-mode resonance filter. The nanostructured grating provides high sensitivity in refractive index sensing, as demonstrated by simulations and experiments in measuring varying contents of the tetrahydrofuran solvent.