Doable for sure but comes the issue of needing runtime libraries. In addition to the link that hdsrob dug up, there's also Script#, which compiles C# to JavaScript. That helped keep me sane a while back.