H
hardieca
Hi,
I have decorated a number of my classes with a custom attribute. I
would like to loop through every type in my application, sniff for the
attribute, and eventually publish the entire list of attribute values
to a webpage. Everything is working, except I'm getting references to
old DLLs that are sitting in the ASP.Net temp directory where my
assemblies are created (C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\My Site\etc...)
Those old DLLs contain stale metadata which I want to exclude from my
sniffer. As of right now, the only way I know how to do this is to
delete the temp folders created and have fresh ones created.
My code look like this:
AppDomain currentDomain = AppDomain.CurrentDomain;
Assembly[] assems = currentDomain.GetAssemblies(); //Gets old
assemblies
Assembly assem;
foreach (assem in assems) {
Type[] types = assem.GetTypes();
foreach (Type t in types) {
MemberInfo inf = t;
object[] attributes;
attributes =
inf.GetCustomAttributes(typeof(MyCustomAttribute), false);
*SNIP*
Is there some way to exclude the old assemblies, delete the old
assemblies, or force all compiled assemblies into a new directory upon
each build?
Many thanks!
Chris
I have decorated a number of my classes with a custom attribute. I
would like to loop through every type in my application, sniff for the
attribute, and eventually publish the entire list of attribute values
to a webpage. Everything is working, except I'm getting references to
old DLLs that are sitting in the ASP.Net temp directory where my
assemblies are created (C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\My Site\etc...)
Those old DLLs contain stale metadata which I want to exclude from my
sniffer. As of right now, the only way I know how to do this is to
delete the temp folders created and have fresh ones created.
My code look like this:
AppDomain currentDomain = AppDomain.CurrentDomain;
Assembly[] assems = currentDomain.GetAssemblies(); //Gets old
assemblies
Assembly assem;
foreach (assem in assems) {
Type[] types = assem.GetTypes();
foreach (Type t in types) {
MemberInfo inf = t;
object[] attributes;
attributes =
inf.GetCustomAttributes(typeof(MyCustomAttribute), false);
*SNIP*
Is there some way to exclude the old assemblies, delete the old
assemblies, or force all compiled assemblies into a new directory upon
each build?
Many thanks!
Chris