Step 1: Why Direct Test Fails
Covalently bonded halogen does not give free $\text{X}^{-}$, so $\text{AgNO}_3$ alone gives no precipitate.
Step 2: Elimination
Heating with alcohol, with AgX, or with KOH and NaOH together does not release a halide ion that can be detected with silver ions.
Step 3: Result
Only option (B) first releases $\text{X}^{-}$ and then precipitates it.
Final Answer:
The halogen is detected by hydrolysis with KOH followed by silver nitrate.
\[ \boxed{\text{(B) }\text{On heating with KOH followed by treatment with dilute AgNO}_{3}\text{.}} \]