tags:

views:

162

answers:

3

Hi all,

I am not able to delete a native image :

del c:\windows\assembly\native...\mscorlib\xxxx\mscorlib.ni.dll
access refused

That works on Windows XP, but not in Seven.

Does someone know how can I do ?

Thanks

+2  A: 

You are probably trying that from a non-elevated command prompt.

However, instead of accessing the GAC from the file system you should use the tools provided by the .NET Framework. A native image can be removed by a call to ngen.exe with the approriate switches (call ngen.exe /? to get help):

ngen uninstall <assembly name> [scenarios] [config]
    Delete the native images of an assembly and its dependencies from
    the Native Images Cache.

Anyway, you are trying to delete the native image of mscorlib. Is there any particular reason you want to remove this image? This looks like asking for trouble to me.

0xA3
I have run with cmd.exe as Administrator, and It is the same problem.I have told mscorlib.ni.dll just for example.
Thomas
A: 

It does not work because Windows Vista and 7 do protect their system directories from unauthorized modificaiton. You will need elevated rights to do this.

Obalix
+1  A: 

Seen this type of behavior before when the file is in use. Get Process Explorer (sysinternals) and do a "find handle or dll" search for the filename. You'll have to kill any process that is using the image.

Will
Used by MOM.exe and CCC.exeThanks
Thomas