I do relate to this for the first time in my life. I don't believe it is related to MS because I think I did mine while pulling my kids on skim boards at the beach just over a week ago. I was limping at the time anyway but the night in bed after my fun with the kids I had severe pain in my knee when straightening my leg.
Next day, while getting out of the car my left knee just buckled and I yelped in pain. I iced the knee for a couple of days and tried to rest it.
It is still gives me a little twinge of pain now and again but I think the ice, rest and not doing any activities that are likely to put twisting pressure on the knee may do the trick.
Hope it comes good for you.
I have something similar, but's from torn cartilage. I have to remind myself that not every ache or pain is necessarily the fault of MS....
I do have muscle spasms and constant nerve tingling and for me at least, it never gets up to the level of pain that my knee does when its inflamed.
It could be from your MS, but if you're having involvement of your legs, you might not be moving with a normal gait and may have done something that can be treated. I see an orthoscopic surgeon for mine, tho I don't qualify yet for surgery! I have a tiny torn flap that usually lies flat, but when it's inflammed from me twisting it or doing something else stupid, I can barely walk on it :)
If you can get into see a doctor quickly, try using heat and ice and see if it helps.
Good luck and hope you're feeling better quickly!
I had surgery for a torn menicus in 1981 when they were finding out there was such a thing. This was before MRIs and when athroscopic surgery was new. The tear itself which happened in 1979 was incredibly painful. Probably one of the most painful times of my life. After the surgery I have done well for 30 years with out pain in that knee.