Blow away ASP.Net temp directory upon build

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
 
H

hardieca

Did you try a full recompilation of the solution?

Still trying to find my legs with VS 2005... I have simply been
building my website, how would I do a full recompilation?

Thanks!

Chris
 
I

Ignacio Machin \( .NET/ C# MVP \)

Still trying to find my legs with VS 2005... I have simply been
building my website, how would I do a full recompilation?

Right click in the solution explorer above the solution name and select
"Rebuild Solution"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top