.NETGURU
Need help to detect code changes in .net assemblies
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.clr.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

H.B
Hi,

I want to find out a way to distinguish between modified dlls
(meaning there has been a code / resource change) and unmodified dlls in of
a build. Because of the MVID and version info, the assembly gets modified
each time I rebuild the project(even without modifying anything in the
code). But I want to find out a way to detect whether the dll actually
changed or not. One possible way to approach this is to extract the il code
and resources then compare those excluding the MVID and what ever other
versioning info, but it is time consuming and requires the use of an
external tool (or is there a way to generate the il code within my program
using .net?).

Or is there a better, faster and efficient way of doing this ? I was
thinking that if I can find the structure of a dll then I can exclude the
MVID and what ever versioning info and compare the rest of the dll file
using a hash comparison or something like that. But couldn't find the
physical structure of an .Net assembly. Can anyone help me ? Thanks.

Reply to this message...
 
    
David Levine
Since it's your own dll you can set the assembly version to change only when
you explicitly change it yourself. You can then check the assembly version
against the last known version. You can also check external things such as
the time-date stamp, the file size, etc. This may be appropriate depending
on what you are really trying to accomlish.

"H.B" <Click here to reveal e-mail address> wrote in message
news:%233nzTT%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
H.B
Actually I am talking about shared assemblies where many programmers are
involved in developing them. I want a way to find out the files that are
modified given only the dlls (better if it doesn't depend on the developer).

Cant check date or time stamp because the batch build that is running
for all the projects builds all the projects creating new assemblies each
time. Actually that is my problem, I want to find only the modified (code or
resources) files of the build.

"David Levine" <Click here to reveal e-mail address> wrote in message
news:#Click here to reveal e-mail address...
> Since it's your own dll you can set the assembly version to change only
when
[Original message clipped]

Reply to this message...
 
    
Stu Smith
"H.B" <Click here to reveal e-mail address> wrote in message
news:%23cbT%Click here to reveal e-mail address...
[Original message clipped]

Surely you can use your source control system for this? You know the time
(or changeset no) of the last build, so you can build a list of all files
changed since then.

[Original message clipped]

Reply to this message...
 
    
Peter Drayton [MSFT] (VIP)
The other suggestions of using a source code control system or the Assembly
version are good ones, BTW.

However, if you really want to crack the file format &examine the bits
yourself, you can - we use the regular Windows PE file format, then we add
an additional set of metadata tables & string/blob heaps to carry the MD &
IL. This format is doc'ed in the ECMA specs - see
http://msdn.microsoft.com/net/ecma/ for full details, or read Serge Lidin's
excellent book on the IL assembler for an easier intro.

--Peter

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification