Please see my comment to the question. Why?
Now, just some notes. The form icon is a different thing, you can really change it easily during runtime. It may even make some sense (different mode of operation, different part of functionality). The icon shown in the Taskbar is a different thing, it is called
application icon. As OS uses it, it should be stored in the PE module (file) in some universal way, not specific to .NET. The application icon is actually build in application
manifest. For an assembly, this is stored in a
module, the one holding an application manifest for the assembly. (Visual Studio supports only creation of the assembles with one module per assembly, but compiling on lower level will allow you to have more then one per assembly, but only one of them will hold the manifest; it's called "main assembly module".)
The MSBuild uses the icon file in this
build step:
http://msdn.microsoft.com/en-us/library/microsoft.build.tasks.generateapplicationmanifest.aspx[
^].
That said, unlike the form icon,
this icon is readonly. And, as you should know, the executable module loaded for execution cannot be modified, no matter how high your permissions are. This is an important protection feature of most modern OS.
And even if you could change this icon by some means (no, I don't think it's possible), it would defeat the purpose of them. OS controls rely on this icon to keep your application well-recognizable; it would not get any notifications if you could change it, because this is not how things are designed.
—SA