Solved

How to determine if an assembly changed after compile?

Posted on 2008-06-11
4
552 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
stamp tool on acrobat 1 25
Denali Software 2 15
Enable copy and pasting even when textbox is disabled 2 16
Problem to page 4 23
Let’s list some of the technologies that enable smooth teleworking. 
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
This video shows how use content aware, what it’s used for, and when to use it over other tools.
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now