473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Can I extract creation time of Assembly via reflection?

Hello:
Been looking at the specs for the WebResources attribute in Net framework 2.0 and looking to emulate
it in 1.1

One of the parts needed extracts the build time of the assembly... But I can't for the life of me
figure out how they did that for . Reflection gets me to a CodeBase -- but not the ghost location --
and the System.IO.Files would get me the time the File was copied into that directory (I havn't
found how to do this -- I'm just guessing...)

So I was wondering if there was an attribute/other that could be reflected on that would return the
true Build date? If so, a code snippet would be...fantastic.

Thanks a million,
Sky
Nov 16 '05 #1
2 5092
Sky,

There is not. The build time is not captured in the assembly anywhere,
and you can't depend on the last modified date of the assembly either,
because the local copy might have been downloaded from somewhere else.

If you are using this for identification purposes, then I would
recommend you use a hash of the assembly, and not the build time.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sky Sigal" <as*******@xact-solutions.removethis.com> wrote in message
news:Om****************@TK2MSFTNGP10.phx.gbl...
Hello:
Been looking at the specs for the WebResources attribute in Net framework 2.0 and looking to emulate it in 1.1

One of the parts needed extracts the build time of the assembly... But I can't for the life of me figure out how they did that for . Reflection gets me to a CodeBase -- but not the ghost location -- and the System.IO.Files would get me the time the File was copied into that directory (I havn't found how to do this -- I'm just guessing...)

So I was wondering if there was an attribute/other that could be reflected on that would return the true Build date? If so, a code snippet would be...fantastic.

Thanks a million,
Sky

Nov 16 '05 #2
Dear Nicholas:
Thanks for that info.

When you say Hash of the Assembly, is it as simple as oAssembly.GetHashCode() -- that's it?

Thank you,
Sky
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message
news:OG**************@TK2MSFTNGP11.phx.gbl...
Sky,

There is not. The build time is not captured in the assembly anywhere,
and you can't depend on the last modified date of the assembly either,
because the local copy might have been downloaded from somewhere else.

If you are using this for identification purposes, then I would
recommend you use a hash of the assembly, and not the build time.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sky Sigal" <as*******@xact-solutions.removethis.com> wrote in message
news:Om****************@TK2MSFTNGP10.phx.gbl...
Hello:
Been looking at the specs for the WebResources attribute in Net framework

2.0 and looking to emulate
it in 1.1

One of the parts needed extracts the build time of the assembly... But I

can't for the life of me
figure out how they did that for . Reflection gets me to a CodeBase -- but

not the ghost location --
and the System.IO.Files would get me the time the File was copied into

that directory (I havn't
found how to do this -- I'm just guessing...)

So I was wondering if there was an attribute/other that could be reflected

on that would return the
true Build date? If so, a code snippet would be...fantastic.

Thanks a million,
Sky


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
1
by: andrew queisser | last post by:
I've been trying to dynamically create a class DevT that's derived from a generic base GenBase<T>. It doesn't seem to work. I'm attaching a code sample below that illustrates the problem. ...
2
by: Chris Green | last post by:
I would welcome any advice someone could offer on the follow problem. I need to code a command line utility in c sharp. The utility will accept a single parameter; the name of a cs file (not an...
1
by: danielhardman | last post by:
I am implementing a component that helps a developer with som localization tasks at design-time, and provides some related feature at run-time. My problem is that in order to do the design-time...
0
by: none | last post by:
Hello This question is more Interop related but since that newsgroup seems to be abandoned, I thought I give this newsgroup a try. I have an OCX that exposes several classes and I need to...
14
by: Nak | last post by:
Hi there, Does anyone know how I would get the value of the assembly GUID in code from within the same application? Thanks in advance. Nick. --...
0
by: DotNet Guerrilla | last post by:
I deployed an application to our production server that has one web service reference and I am getting the following error. In my dev laptop work fine the error is in our prod server. Please...
13
by: Tim | last post by:
When the Application is started, it has to read a config file. The config file gives details of the objects that need to be created. Based on the info from the config file, the objects need to be...
11
by: Sean M. DonCarlos | last post by:
I have an unmanaged Win32 app that looks up the name of a DLL (unknown at compile time) from an external location, loads it with LoadLibrary, and then uses GetProcAddress on three exported...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.