Determining if a class refers to C #

I am curious if it can be determined whether the Assembly referred to a particular class or not. I am currently using Reflection to load Assemblies, and then I determine which assemblies are referenced in the assembly that I am loading:

foreach (var vReferencedAssembly in vSomeAssembly.GetReferencedAssemblies())

Now that I know what the assemblies refer to, I want to dig out these vReferencedAssembly and determine if something like this is happening:

File.Create(vSomeFile);

In plain English, I don’t want to download the assembly from the list provided to me, which may contain what I consider a threat. Therefore, I can block files that can manipulate files, etc.

+5
source share
1 answer
+2

All Articles