Wednesday, December 24, 2003

Source: WebLogs @

Okay, it's time to take the wraps off. Kathleen Dollard, simply the smartest person I know, has finished her Code Generation in Microsoft .NET book for APress.

I guarantee that this will be the hardest book you read in 2004, but also that it will be the single most important book for making you as productive as you can be as a .NET or SQL Server programmer.

You know all that boring, repetitive code you write for a typical application? Do away with it and generate it automatically, letting you focus on all the custom, interesting, fun, and ground-breaking code that goes into every application.

Disclaimer: I am the book's tech editor and was Kathleen's go-to guru for XSLT. So I'm intimately familiar with everything the book talks about--particularly as chief guinea pig, since I was the first person to do a real application using her templates and techniques--and I can heartily recommend it. Even if you use a framework or other development technologies, you'll learn a lot from her explorations of codegen in .NET.

My #1 book recommendation for 2004, even though it hasn't started yet!

[WebLogs @]
6:50:14 PM    trackback []     Articulate [] 

Source: Frans Bouma's blog

Signing your assembly, newbie guide.

Follow these easy steps. The first 4 steps you only have to do ONCE in your life. Step 5-7 you only have to do ONCE per project.

  1. Open a command prompt
  2. Type vsvars32.bat (enter) or navigate to the .NET bin dir
  3. Type: sn -k mykey.key (enter)
  4. Move mykey.key to a folder where it gets backupped daily, for example: c:myfileskeys
  5. Open your code's solution in Visual Studio.NET
  6. Open the AssemblyInfo class in the editor
  7. For the attribute AssemblyKeyFile(), specify instead of the default "", the full path of your key, in our example this is "c:\myfiles\keys\mykey.key", so the attribute in full will be:
    C#: [assembly: AssemblyKeyFile("c:\\myfiles\\keys\\mykey.key")]
    VB.NET: <Assembly: AssemblyKeyFile("c:\myfiles\keys\mykey.key")>
  8. Compile your solution. After compilation, your assembly is signed with your strong key.
  9. To congratulate yourself with this big achievement, walk to the fridge and pop open a fresh Heineken.

*Pfew* I have to lay down now to take some rest after this long, thorough lecture. Sorry people, but you don't need a plugin which requires registration to do this easy stuff. If you can program software, you can sign your assembly. If not, what are you doing near that keyboard? ;)

The signed assembly can be freely distributed to your clients/customers. They can reference it in their .NET projects without having to worry about public keys, public tokens or other hard to understand material. The world is already very complex, let's not make the easy stuff look like it's very complex also.

Update: Thanks to 'Prima Donna' Robert Mclaws for pointing to a typo in the title.

Kereltje, zodra jij zo goed Nederlands lult als ik Engels, heb je recht van spreken.

[Frans Bouma's blog]
2:39:22 PM    trackback []     Articulate []