我使用Assembly查询文件的Version等信息,使用了如下代码: string filepath = @"D:\testfiles\test\d.dll";
string newfilepath = @"D:\testfiles\new\d.dll"; Assembly assembly = Assembly.LoadFile(filepath);但是之后,我想讲newfilepath的内容copy到filepath,使用代码: File.Copy(newfilepath, filepath, true);这时发生异常:
"
The process cannot access the file 'D:\testfiles\test\d.dll' because it is being used by another process.
"
我查看了assembly和Assembly(静态方法)好像都没有类似FileStream那样提供Close()等方法,请问我要如何做才能让assembly释放掉对文件的操作呢?谢谢
string newfilepath = @"D:\testfiles\new\d.dll"; Assembly assembly = Assembly.LoadFile(filepath);但是之后,我想讲newfilepath的内容copy到filepath,使用代码: File.Copy(newfilepath, filepath, true);这时发生异常:
"
The process cannot access the file 'D:\testfiles\test\d.dll' because it is being used by another process.
"
我查看了assembly和Assembly(静态方法)好像都没有类似FileStream那样提供Close()等方法,请问我要如何做才能让assembly释放掉对文件的操作呢?谢谢
有人来接分么?
http://topic.csdn.net/u/20100729/09/a24b2dfd-bcb9-4a5b-a259-bda35d1a2a43.html