G
Guest
Has been trying to get an ASP.NET DLL's modification date/time for the
"release date/time" to be displayed on the page's footer
Using:
System.Reflection.Assembly
asm=System.Reflection.Assembly.GetExecutingAssembly();
appVer = asm.GetName().Version.ToString();
// get the location of our executing assembly
System.IO.FileInfo inf = new System.IO.FileInfo(asm.Location);
DateTime dt = inf.LastWriteTime;
appDate = dt.ToString("d MMM yyyy")
log.Info ("asm.Location=" + asm.Location);
However, the debug log indicate that it is reading the last write time from
c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net
files\MyProd\0bb3e1a5\e740ffe2\assembly\dl2\a5a61754\024e623d_c70bc601\MyCompany.MyDept.MyProd.dll and not c\inetpub\wwwroot\MyProd\bin\MyProd.dll
How can I update my code to read the last modification date/time of where
the DLL was deployed?
Note the
1) Problem happens both on IIS5.1 / Win XP Pro SP2 and IIS6 / Windows 2003
server
2) .Net framework 1.1
3) Impersonation is used, impersonating the logged on user (no admin
priviledges)
"release date/time" to be displayed on the page's footer
Using:
System.Reflection.Assembly
asm=System.Reflection.Assembly.GetExecutingAssembly();
appVer = asm.GetName().Version.ToString();
// get the location of our executing assembly
System.IO.FileInfo inf = new System.IO.FileInfo(asm.Location);
DateTime dt = inf.LastWriteTime;
appDate = dt.ToString("d MMM yyyy")
log.Info ("asm.Location=" + asm.Location);
However, the debug log indicate that it is reading the last write time from
c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net
files\MyProd\0bb3e1a5\e740ffe2\assembly\dl2\a5a61754\024e623d_c70bc601\MyCompany.MyDept.MyProd.dll and not c\inetpub\wwwroot\MyProd\bin\MyProd.dll
How can I update my code to read the last modification date/time of where
the DLL was deployed?
Note the
1) Problem happens both on IIS5.1 / Win XP Pro SP2 and IIS6 / Windows 2003
server
2) .Net framework 1.1
3) Impersonation is used, impersonating the logged on user (no admin
priviledges)