I always cook the pasta in advance of baking it in the oven. The only time I've ever tried using raw noodles in a pasta dish in the oven was with those no-cook lasagna noodles, but we weren't very pleased with the results from them either since they too cooked unevenly. The key thing I do though after boiling the pasta is to let it rest in the drainer until the steam stops rising off of it, and I give it a few stirs as well to release the excess heat and moisture from the center of the mound of pasta. That way know its dried off enough that it won't make the baked pasta dish all watery and soupy by giving off too much excess liquid during the cooking process. I will also slightly under cook it a bit too, so it soaks up some of the sauce while it bakes.
Gnocchi sounds interesting, but challenging for a couple reasons - they are rather delicate, especially the really fresh stuff, and can kind of disintegrate into the sauce. Also they are very rich, so I would be careful about what sauce and cheese I pair them with.
My favorite way to make baked pasta is with marinara, diced smoked ham, dollops of seasoned ricotta (some egg, parmesan, herbs, salt and pepper) nestled into the pasta, diced hard boiled eggs (this is traditional from what I've read, I believe it's more common in Sicily), and topped with mozarella.