Bring a large pot of heavily salted water to a boil. Add the pasta and cook for 4 minutes. Add the green beans to the pasta and cook for another 4 minutes. Reserve about 1 cup of the cooking water and drain the pasta and green beans.
In a large skillet, melt the butter over medium high heat. Add the mushrooms and cook until they start to brown, about 6 – 7 minutes. Add the stock and cream, bring to a boil, reduce heat and simmer for 2 minutes. Stir in the Parmesan cheese then add the pasta and green beans. Add kosher salt and black pepper to taste. Stir to combine. Add a little pastawater if the sauce is too thick. Pour the mixture into a 9 inch by 12 inch baking dish and bake for 20 – 30 minutes or until heated through and bubbly.
While the casserole is baking, prepare the shallots. Line a plate with paper towels. Pour enough oil into a large skillet to come up ¼ inch. Heat over medium-high heat. Reduce the heat to low, add the shallots and let cook for 12 minutes, the shallots should be quite soft. Raise the heat to high and cook, stirring often, until the shallots are well browned. Remove with a slotted spoon and let drain on the paper towels. Sprinkle with salt. The shallots will crisp more as they cool.
When the casserole is done, scatter the shallots over the top and serve.