How to remove the key from a strong name assembly?

G

Guest

After assigning a key to a DLL to make it a strong name assembly, it cannot be compiled to the same location again.
The VS.NET always shows
"Could not copy temporary files to the output directory.
The file 'xxx.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.
and the DLL file is locked and cannot be deleted or overwritten
This is probably the effect of assigning the key but it is not what I want because my DLL will need frequent update

Anybody can help me.............thx a lot!!!
 
D

Daniel Bass

to remove the file:
unregister the file first from the GAC, then you can delete it.

to remove the strong name:
search for all reference of ".snk" in your project and remove them

hope that helps.
Dan.

After assigning a key to a DLL to make it a strong name assembly, it cannot
be compiled to the same location again.
The VS.NET always shows
"Could not copy temporary files to the output directory.
The file 'xxx.dll' cannot be copied to the run directory. The process cannot
access the file because it is being used by another process."
and the DLL file is locked and cannot be deleted or overwritten.
This is probably the effect of assigning the key but it is not what I want
because my DLL will need frequent update.

Anybody can help me.............thx a lot!!!
 
G

Guest

Thank you for your suggestions
For 1, I didn't put the dll in GAC because it is used by one project only. So I can't follow this step
For 2, I've remove the sgKey.snk file but didn't help

Here was my steps in assigning the key
1. compile xxx.dll using VS.NET
2. use sn.exe to generate a key (sn -k sgKey.snk
3. use sn.exe to assign the key to the DLL file (sn -R xxx.dll sgKey.snk
4. use regasm.exe to register it (regasm xxx.dll /codebase

I've already unregister using regasm but still cannot delete the dll file. Any hints
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top