You can do whatever you want. The .NET compilers are usually command line applications, you can find them at
%windir%\Microsoft.NET\FrameWork\<framework version>
e.g
%windir%\Microsoft.NET\FrameWork\v4.0.30319\csc.exe
For .NET 4
But I do not understand the idea behind it, why do you want to hard code a certain string in an executable? why not put it in a config file for example...