In 538, during a major campaign between Western Wei and Eastern Wei, Wei Xiaokuan accompanied Emperor Wen, and he was made the governor of Hongnong Commandery (弘農, roughly modern Sanmenxia, Henan). He subsequently entered Luoyang (which Western Wei temporarily captured) with Dugu Xin, and for some time tried to defend the city, but eventually they were forced to withdraw from the vicinity of Luoyang.
In 538, during a critical period in the conflict between Western Wei and Eastern Wei, Emperor Wen's trusted advisor, Wei Xiaokuan, played a key role. Wei Xiaokuan was appointed governor of Hongnong Commandery and led an effort to defend Luoyang against Western Wei's forces before being compelled to withdraw from the area.