Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

Blow away ASP.Net temp directory upon build

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hardieca@hotmail.com - 18 Jul 2007 13:49 GMT
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
Ignacio Machin ( .NET/ C# MVP ) - 18 Jul 2007 15:08 GMT
Hi,

Did you try a full recompilation of the solution?

> Hi,
>
[quoted text clipped - 32 lines]
>
> Chris
hardieca@hotmail.com - 19 Jul 2007 13:49 GMT
> 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
Ignacio Machin ( .NET/ C# MVP ) - 19 Jul 2007 18:27 GMT
>> 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?

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.