How can I get a list of assemblies in a given location? I’m trying to reflect over the appdomain, and that’s giving me everything that’s loaded. I just want what’s in the executing assembly’s directory.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The solution provided by BtBh works to find all files with extension .dll. Ricards remarks that only .Net runtime can tell you what is valid assembly. This means that you would have to explicitly load every .dll file found to check whether it is a valid .Net assembly (it could just be a plain old Windows dll). As mentioned by Josh there is a static method Assembly.ReflectionOnlyLoadFrom that allows you to load assemblies for inspection via reflection.