?
Solved

How to determine if an assembly changed after compile?

Posted on 2008-06-11
4
Medium Priority
?
566 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
[X]
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
  • 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

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…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

800 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