Free tool: AssemblyInfo

Have you ever come across an assembly file you wanted to know as much as possible about, without running it? Have you ever had problems with deployment, because you weren't sure what version of a DLL you copied on a machine? How do you tell the difference between a 32 bit and 64 bit assembly anyway?

I created a little command line tool, which dumps a lot of information about an assembly. For example, here is the output of the tool when run against itself:

AssemblyInfo (c) 2007 Kris Vandermotten 
File: 
 AssemblyInfo.exe 
COFF Header: 
 File is executable (EXE). 
 File is 32 bit. 
 Target machine:     I386 
PE Header: 
 File is a 32 bit PE file. 
 Linker Version:     8.0 
 Image Base Address: 0x00400000 
 Section Alignment:  8192 
 File Alignment:     4096 
 OS Version:         4.0 
 Image Version:      0.0 
 Subsystem Version:  4.0 
 Subsystem:          WINDOWS_CUI 
Version information: 
 File Version:       1.0.0.0 
 Product Version:    1.0.0.0 
 Language: Language Neutral, Codepage 1200 
  OriginalFilename:  AssemblyInfo.exe 
  FileDescription: 
  AssemblyInfo 
  FileVersion:       1.0.0.0 
  InternalName:      AssemblyInfo.exe 
  CompanyName:       Kris Vandermotten 
  LegalCopyright:    Copyright (c) 2007 Kris Vandermotten 
  LegalTrademarks: 
  ProductName:       AssemblyInfo 
  ProductVersion:    1.0.0.0 
  PrivateBuild: 
  SpecialBuild: 
  Comments: 
Assembly: 
 Name:               AssemblyInfo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e56d967875f629d3 
 Hash Algorithm:     SHA1 
 Processor:          MSIL 
 Runtime Version:    v2.0.50727 
 EntryPoint:         Void Main(System.String[]) in AssemblyInfo.Program
 Modules: 
 AssemblyInfo.exe 
  PE Kind:           ILOnly 
  Machine:           I386 
  X509 Certificate:  none 
Referenced Assemblies: 
 mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 
Assembly Attributes: 
 [System.Reflection.AssemblyProductAttribute("AssemblyInfo")] 
 [System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(WrapNonExceptionThrows = True)] 
 [System.Runtime.InteropServices.GuidAttribute("5eb90c8e-1aa6-4739-917e-0d4117b78ba9")] 
 [System.CLSCompliantAttribute((Boolean)True)] 
 [System.Runtime.InteropServices.ComVisibleAttribute((Boolean)False)] 
 [System.Reflection.AssemblyTrademarkAttribute("")] 
 [System.Reflection.AssemblyCopyrightAttribute("Copyright (c) 2007 Kris Vandermotten")] 
 [System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 
 [System.Reflection.AssemblyCompanyAttribute("Kris Vandermotten")] 
 [System.Reflection.AssemblyConfigurationAttribute("")] 
 [System.Reflection.AssemblyDescriptionAttribute("")] 
 [System.Reflection.AssemblyTitleAttribute("AssemblyInfo")] 
 [System.Diagnostics.DebuggableAttribute((System.Diagnostics.DebuggableAttribute+DebuggingModes)2)] 
 [System.Runtime.CompilerServices.CompilationRelaxationsAttribute((Int32)8)]

Download AssemblyInfo and enjoy.

Technorati Tags: , , ,

Generate documentation for your FxCop rules

I must admit that I am a big fan of FxCop (or Visual Studio "Code Analysis"). I believe the power of FxCop is underestimated, and the FxCop team more than deserved the award they got.

Many organizations develop their own frameworks, to support the applications they are building, to increase the productivity of their developers, to enforce standards and reduce maintenance costs. Building custom Code Analysis rules is a powerful way to augment those frameworks. You can verify that the frameworks are used the way they are supposed to be used. And if not, you can politely assist the developer to use the framework correctly.

Developing custom Code Analysis rules is not hard at all, and you can expect some posts in the future about the subject. But first I want to talk about something else: those rules need to be documented too!

As it turns out, every rules assembly contains an XML resource with a description for all the rules in the assembly. So why would you want to duplicate that information in separate documentation? Well, for the same reasons that you want to generate proper documentation from you XML comments in C#, C++ or VB source code: make it human (=user) readable!

So I created a little tool to generate an HTML file based on the XML resource in the rules assembly. I intend to build on this in the future, but a 1.0 version is here, ready to be downloaded. To get an idea of the output it produces, here's a screen shot of the HTML for one of the standard rules assemblies (the smallest one):

MobilityRules

Obviously, there isn't much of a point generating this for the standard rules, they're well documented in the MSDN. But this may come in handy for your own rules. Let me know if you like the idea, or which additional features you need.

Parallel Extensions to .NET Framework 3.5 CTP Released

Yesterday, Somasegar announced the release of the first ParallelFX CTP on his blog.

As Soma puts it, ParallelFX contains:

  • Imperative data and task parallelism APIs, including parallel for and foreach loops, to make the transition from sequential to parallel programs simpler.
  • Declarative data parallelism in the form of a data parallel implementation of LINQ-to-Objects.  This allows you to run LINQ queries on multiple processors.
  • First class tasks that can be used to schedule, wait on, and cancel parallel work.
  • New concurrency runtime used across the library to enable lightweight tasks and effectively map and balance the concurrency expressed in code to available concurrent resources on the execution platform.

I believe this will significantly simplify multithreaded development for .NET, to the extent we might actually get to see programs that use those dual or quad core CPU's you all want for Xmas.

Download it from MSDN.