How exactly is an exe loaded into memory

http://msdn.microsoft.com/en-us/magazine/cc301805.aspx
http://www.codeproject.com/Articles/13897/Load-an-EXE-File-and-Run-It-from-Memory
http://www.joachim-bauch.de/tutorials/loading-a-dll-from-memory/




Synchronization Context articles: 
http://msdn.microsoft.com/en-us/magazine/gg598924.aspx(It's all about Synchronization Context)
http://www.codeproject.com/Articles/31971/Understanding-SynchronizationContext-Part-I


STA Threads:
http://blogs.msdn.com/b/jfoscoding/archive/2005/04/07/406341.aspx(Why is STAThread request)




book: Window internal




The original question is that: as portal executional is loaded into memory, then why can't it be replace when it's running?
Also take some time to find out why vs can edit code when it's debugging. 






Load assembly from disk programmaticly. 
using(FileStream fs = new FileStream("", FileMode.Open))
{
BinaryReader br = new BinaryReader(fs);
Byte[] bin = br.ReadBytes(Convert.ToInt32(fs.Length));
Assembly a = Assembly.Load(bin);


MethodInfo entry = a.EntryPoint;
if (entry != null)
{
object o = a.CreateInstance(entry.Name);
entry.Invoke(o,null);
}
};



MKVDS_SHRTNAMLNX1_CP

你可能感兴趣的:(How exactly is an exe loaded into memory)