The amazing CLR runtime re-appearing trick

My blog has moved.
You can view this post at the following address:
http://www.osherove.com/blog/2004/3/18/the-amazing-clr-runtime-re-appearing-trick.html
Published Thursday, March 18, 2004 11:16 PM by RoyOsherove
Filed under:

Comments

Thursday, March 18, 2004 7:22 PM by JosephCooney

# re: The amazing CLR runtime re-appearing trick

Are they being protected by Windows File Protection?
Thursday, March 18, 2004 7:23 PM by JosephCooney

# re: The amazing CLR runtime re-appearing trick

Sorry, to clarify - is mscorlib.dll being protected by WFP? This could explain this behavior.
Thursday, March 18, 2004 7:31 PM by Roy Osherove

# re: The amazing CLR runtime re-appearing trick

Joseph: *gulp* silly me. It is indeed WFP that is restoring that file automatically out of System32\dllCache.
There's a great article that describes what WFP is and how to configure it.
Thanks for the heads up!
Thursday, March 18, 2004 8:41 PM by Dave

# re: The amazing CLR runtime re-appearing trick

Are you sure it's WFP that's restoring the file, as that usually kicks in straight away (if you sit and watch the the folder the file comes back).

It could be the msi based installation repairing itself.
Thursday, March 18, 2004 8:47 PM by Matt Warren

# re: The amazing CLR runtime re-appearing trick

You are all wrong. It is little elves.
Thursday, March 18, 2004 11:05 PM by JosephCooney

# re: The amazing CLR runtime re-appearing trick

Elves? No - The CLR loves you Roy, and wants you to be happy.
Friday, March 19, 2004 3:23 AM by LeeB

# re: The amazing CLR runtime re-appearing trick

If it was WFP then presumably this would repair NET1.0 as well since WFP is a core Windows service?
Friday, March 19, 2004 4:57 AM by Martin Liversage

# re: The amazing CLR runtime re-appearing trick

I don't know if mscorlib.dll is protected by WFP, but either you are seeing WFP kicking in or it is Windows Installer that repairs your installation.

Windows Installer is actually quite amazing in that respect, but being a developer I have been bitten by this behaviour a few times. I remember once where we were in the late testing phases and all our software was installed by Windows Installer as we would ship it. The testers found a bug and to in order to fix it I had to create a special instrumented DLL. I was in a hurry so instead of building a new installer I stuffed the new DLL on a floppy, whizzed into the test lab, dragged the new DLL on top of the old one in Explorer and started the app when, doooh... Windows Installer started and "repaired" my application overwriting my instrumented DLL with the original DLL. In theory I knew that this would happen, but seeing the "magic" being done at a stressed moment was a fun experience since it was both nice and annoying at the same time. Actually, we could delete the complete app, and as long as the shortcut was in place Windows Installer would install and repair the application. The app was off course published using AD so the shortcut was always there. Windows Installer is your friend.
Friday, March 19, 2004 9:09 AM by AndrewSeven

# re: The amazing CLR runtime re-appearing trick

I demoed this functionality (WFP) with Guy Barrette at DevDays 99 here in Montreal.

We had tried the demo a couple times with notepad.exe.

When we got on stage to do the demo, the file was getting restored so fast that it seemed as though we were not really saying ok to the delete file prompt.

So we started deleting other files ... people were impressed. :)
Friday, March 19, 2004 3:45 PM by Mani Swaminathan

# re: The amazing CLR runtime re-appearing trick

It does not work!!

i got the following error (my program was compiled for debug!!)

The error message was

Failed to delay load library mscorb.dll (Win32 error: 2)

This program can no longer run and will now terminate

PS:
Btw i used to work with Addy Santo!!
Friday, July 23, 2004 2:41 PM by Kurtis

# re: The amazing CLR runtime re-appearing trick

Well, I've been everywhere on this and i really need help. I keep getting this message:
Fatal Error failed to delay load library mscorlib.dll Win32 err. 998
Also I cant download anything but after so many calls and techs I think that this is a problem related to error message.
Thanks for the help