Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to determine if an assembly changed after compile?

Posted on 2008-06-11
4
560 Views
Last Modified: 2013-12-12
We are about to do an initial deployment of our fixedname ASP.Net app and we are contemplating the bug fix process.  With each fix, we would like to release only the files affected.  Rather than rely on the developer to track which files changed for the fix, we would like to automate the process as much as possible.  This was pretty easy to do in classic ASP but in DotNet we are choosing to release only DLLs which means that the whole site is recompiled even though only one page changed.  The end result is that all assemblies have different timestamps as well as different binary signatures (the CRC on the binary is different even though the source code did not change).  How do we programmatically determine which assembly (dll) changed as the result of code change?

I know the easy answer is to use the DLL timestamp but this does not work for us since the Aspnet_compiler does not seem to operate as advertised.  In otherwords, when we exclude the -c option only the changed components should be recompiled but my whole destination site is deleted and complied each time.  Does this work for anyone else?

Below are the compile options we use.  Note that we are using strong names with the hope it will discourage application tampering.

aspnet_compiler -v myApp  -p "C:\temp\myApp" -f -d c:\App -nologo -fixednames -errorstack -keyfile c:\temp\MyStrongNameKey.snk aptca

A related question is how do we inject version numbers into page assemblies (and App_Code.dll) and can we use these version numbers to determine if a file changed?  

Are these legitimate questions or is there an easier way to go about doing what we are trying to do?

Another question: is it appropriate to place all our business logic in App_Code or should we manage it externally and place separately compiled dlls in our bin directory?


Thanks,

Derek
0
Comment
Question by:yknotup
  • 3
4 Comments
 
LVL 5

Expert Comment

by:Qaiser_Mehmood_Mughal
ID: 21766611
If you want to just know using some tool, is the assembly is change or not.
then use following tools for this.

1.ExamDiff.
2. Compare Suit.

These two tools are very best for checking the changings.

QMM
0
 

Author Comment

by:yknotup
ID: 21778025
Hi QMM,

Thank for the suggestion.  Let me research these tools and I'll get back to you.  

Derek
0
 

Author Comment

by:yknotup
ID: 21780091
QMM,

Unfortunately, file compare utilities like examDiff.exe and Compare Suite are not what I'm looking for since file comparisons against compiled code will always show differences between different compiles even if the source code has not changed (at least using the aspnet_compiler.exe).  The only thing that is the same is the file size.  

I did a bit more research and what does help me a little is placing the following code in my web.config file.

      <system.codedom>
            <compilers>
                  <compiler language="c#;cs;csharp" extension=".cs"
            type="Microsoft.CSharp.CSharpCodeProvider, System,
      Version=2.0.3600.0, Culture=neutral,
      PublicKeyToken=b77a5c561934e089" warningLevel="0"
                          compilerOptions="<dir>\AssemblyInfo.cs" />
            </compilers>
      </system.codedom>

I understand this file is automatically created for Web Application Projects and is located under the Properties directory but since we manage our site by just opening the website, we have to manually create and reference this file.

As far as I can tell, this is only a partial solution since this gives us the ability to version App_Code DLLs but not our individual page DLLs (since we compile each ASPX file to individual assemblies).  Now I can us this App_Code DLL version to programmatically determine which DLLs have changed and, therefore, which DLLs to include in my fix release.

Does anyone know how to version individual assembly ASPX DLLs?

Thanks,

Derek
0
 

Accepted Solution

by:
yknotup earned 0 total points
ID: 21874200
The route we will be trying will be to convert our web site into a web application and break up our AppCode directory into as many separate C# Library projects as we deem appropriate.  It takes a little bit of code restructuring  but not much.  In the end we will have a VSS Solution project with a few c# librariy projects and a web application project.  The Web Application Project will reference the C# libraries via project references.

In case of fixes to a released sited, since everything is in vss we know what files changed and therefore can release the minimum amount of files and/or dlls.

Derek
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Calibrating x & y screen  pixel coordinates 1 39
How to read text with RegEx... 2 25
VB.NET Textbox input validation 4 37
Install IIS7.5 on Windows Sever 2012 R2 4 23
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question