.NET code which is using .NET Framework libraries can't run on Raspberry Pi as it requires an ARM compatible version of NETMFNETMF or CLRCLR to run. As of now, Microsoft has yet to release Windows on ARM (WoA). Refer to Experiment 19Experiment 19 for Microsoft Research CLR works on ARM.
However, running .NET code (without reference or using .NET Framework Libraries) is possible using Mono as Mono has a CLR for ARM devices.
See also Building Windows for the ARM processor architectureBuilding Windows for the ARM processor architecture for information on Windows on ARM (WoA).