Click here to Skip to main content
15,923,557 members
Home / Discussions / C#
   

C#

 
QuestionCan I see the .Net Class Lib's source code? Pin
Feng Qin30-May-02 16:29
Feng Qin30-May-02 16:29 
AnswerRe: Can I see the .Net Class Lib's source code? Pin
Rama Krishna Vavilala30-May-02 16:53
Rama Krishna Vavilala30-May-02 16:53 
GeneralRe: Can I see the .Net Class Lib's source code? Pin
Nish Nishant30-May-02 17:24
sitebuilderNish Nishant30-May-02 17:24 
GeneralRe: Can I see the .Net Class Lib's source code? Pin
Rama Krishna Vavilala30-May-02 18:33
Rama Krishna Vavilala30-May-02 18:33 
GeneralRe: Can I see the .Net Class Lib's source code? Pin
Nish Nishant30-May-02 19:32
sitebuilderNish Nishant30-May-02 19:32 
GeneralRe: Can I see the .Net Class Lib's source code? Pin
Rama Krishna Vavilala31-May-02 1:54
Rama Krishna Vavilala31-May-02 1:54 
AnswerRe: Can I see the .Net Class Lib's source code? Pin
James T. Johnson30-May-02 17:28
James T. Johnson30-May-02 17:28 
GeneralReflection and file deletion Pin
Orion Buttigieg30-May-02 15:41
Orion Buttigieg30-May-02 15:41 
hello,

to get information from the dll ie. the methods,types, parameters i use Reflection. at certain times i have to delete this dll which is usually not a problem. the problem is once i've reloaded a dll and performed some reflection on it, that when i go to delete the dll using FileInfo.Delete() i get an Access is Denied exception. so its as if the dll is still being used or a thread that's still alive or.... this one's got me stumped. maybe there's a better way of reflecting the information from the dll or something.

here's the code starting with the Reflection: pretty straight forward. so i get the dll pass it into an Assembly and there you go. for what i need to do i think its about the easiest least overhead way.

string tempPath = Path.GetTempPath();//Gets the path to the MS tempdir
string strMSTempPath = tempPath.Replace(@"\", @"\\");
string strTempName = strNameSpace + ".dll";
Assembly ass = Assembly.LoadFrom(strMSTempPath + strTempName);
string strObject = strNameSpace + "." + strServiceName;
Type typeDynProxy = ass.GetType(strObject);
MethodInfo[] methodArray = typeDynProxy.GetMethods(BindingFlags.Public|BindingFlags.Instance);

this is how i delete the dll from the directory. nothing fancy.

string tempPath = Path.GetTempPath();
string strTempName = tempDeleteDLL + ".dll";
FileInfo fileInfo = new FileInfo(tempPath + strTempName);
fileInfo.Delete();

throws the Exeption as soon as it executes Delete():
"Access to the Path C:\..\..\ is denied."
normally i can delete the dll. just not after i run the Reflection code above.

any ideas or help would be great.

thanks


Orion
GeneralRe: Reflection and file deletion Pin
James T. Johnson30-May-02 17:06
James T. Johnson30-May-02 17:06 
GeneralRe: Reflection and file deletion Pin
Orion Buttigieg31-May-02 5:58
Orion Buttigieg31-May-02 5:58 
GeneralRe: Reflection and file deletion Pin
Eric Gunnerson (msft)31-May-02 8:40
Eric Gunnerson (msft)31-May-02 8:40 
GeneralRe: Reflection and file deletion Pin
Orion Buttigieg31-May-02 8:42
Orion Buttigieg31-May-02 8:42 
GeneralComboBox in Winforms Pin
30-May-02 14:42
suss30-May-02 14:42 
Questionasynchronous calls & threading. which is better? Pin
Li-kai Liu (Angus)28-May-02 23:05
Li-kai Liu (Angus)28-May-02 23:05 
AnswerRe: asynchronous calls & threading. which is better? Pin
Nish Nishant29-May-02 1:46
sitebuilderNish Nishant29-May-02 1:46 
AnswerRe: asynchronous calls & threading. which is better? Pin
Eric Gunnerson (msft)29-May-02 8:18
Eric Gunnerson (msft)29-May-02 8:18 
GeneralRe: asynchronous calls & threading. which is better? Pin
Nish Nishant29-May-02 8:28
sitebuilderNish Nishant29-May-02 8:28 
GeneralRe: asynchronous calls & threading. which is better? Pin
Eric Gunnerson (msft)29-May-02 8:25
Eric Gunnerson (msft)29-May-02 8:25 
GeneralRe: asynchronous calls & threading. which is better? Pin
Li-kai Liu (Angus)29-May-02 17:29
Li-kai Liu (Angus)29-May-02 17:29 
GeneralRe: asynchronous calls & threading. which is better? Pin
Not Active29-May-02 18:13
mentorNot Active29-May-02 18:13 
GeneralRe: asynchronous calls & threading. which is better? Pin
Eric Gunnerson (msft)30-May-02 6:39
Eric Gunnerson (msft)30-May-02 6:39 
GeneralRe: asynchronous calls & threading. which is better? Pin
Eric Gunnerson (msft)30-May-02 7:04
Eric Gunnerson (msft)30-May-02 7:04 
GeneralRe: asynchronous calls & threading. which is better? Pin
James T. Johnson29-May-02 18:16
James T. Johnson29-May-02 18:16 
GeneralRe: asynchronous calls & threading. which is better? Pin
Eric Gunnerson (msft)30-May-02 7:03
Eric Gunnerson (msft)30-May-02 7:03 
GeneralRe: asynchronous calls & threading. which is better? Pin
James T. Johnson30-May-02 17:06
James T. Johnson30-May-02 17:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.