Beethoven wrote it in 1800–01 and dedicated it to Count Moritz von Fries, a banker and patron who also received his String Quintet Op. 29 and the Seventh Symphony. He first planned it as a pair with his Fourth Sonata, Op. 23, and the two were advertised together, but they ended up with separate opus numbers. Nobody knows why.
It was his first violin sonata in four movements, with a short scherzo added between the slow movement and the finale. The name “Spring” is not Beethoven’s; it seems to have been attached after his death. He wrote these sonatas to play himself with various violinists, and the piano is a full partner rather than an accompanist.