# Tuesday, November 11, 2008

At Vertica we employ a wide range of Microsoft server products in our solutions to maximize customer value. To help us manage these often complex environments we rely heavily on virtualization. For the longest time the obvious choice was Microsoft Virtual PC simply because it was there and freely available to use and just being able to run a virtual machine was amazing in its own right.

Our default setup when developing in the virtual environment is to install everything needed inside the virtual machine and use that exclusively. Running IIS, a couple of server products with Visual Studio and ReSharper works well but we’ve found that performance leaves something to be desired.

The obvious answer is to move Visual Studio out of the virtual environment, do development on the physical machine, and deploy the code to the virtual environment and test it there. Basically I require two things from this: 1) Pushing the build to the server should be very simple, 2) Debugging must be supported.

Pushing Code

We’ve got a bunch of options for pushing code to another environment: Publish Wizard in Visual Studio, msbuild or nant tasks, Powershell, and my personal favorite bat files :)

I wanted to create a generic solution which doesn’t dictate the use of msbuild or any other technology so I went with a bat file which in turns calls robocopy. With this in place we’re able to push files over the network to the target VM. Of course a one-time configuration of the virtual environment is needed but that isn’t in scope for this thing.

Download my deploy bat file. Basic usage Deploy c:\MyWebSite \\MyServer\MyWebSiteVDir.

Robocopy is part of the Windows Server 2003 Resource Kit.

Remote Debugging

Second requirement is debugging. I want a solution which is on par with running Visual Studio inside the virtual environment and that means debugging people! :)

The steps for doing remote debugging are well documented but for completeness sake I will include them here with nice screenshots to go along.

1) Copy Remote Debugger from \program files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger to somewhere on the virtual machine, e.g. desktop.

2) Run Remote Debugger on virtual machine (msvsmon.exe).

3) Grab the qualifier from the Remote Debugger (You’ll need it in a second).

Remote-Debugger-Qualifier

4) Connect to Remote Debugger from VS on physical machine via Debug > Attach to Process (CTRL + ALT +P)

5) In the Qualifier input field enter the qualifier from Remote Debugger window.

Visual-Studio-Attach-To-Process 

Volia. Set a break point on the remote machine and see the code break in Visual Studio.

VMWare

I stated earlier that we’re using Microsoft Virtual PC which is true but it’s also true that we’re looking into VMWare Workstation. My first reason for doing so is the performance boost which comes from running in VMWare. I haven’t done any sort of scientific testing of how much faster we’re talking about suffice it to say that it’s enough that you notice it when you’re going about your business in the virtual environment. VS is faster, compiles are faster, everything is just smoother. In my book the best sort of performance metric there is :)

Additionally VMWare provides other interesting features. The first one you’ll see is that storing and restoring state of a VM is blazingly fast. Enough so that you’ll actually find yourself using the feature all the time. I know I am.

Secondly VMWare supports multiple monitors. That’s right. Simply select how many monitors you want supported and it’ll do it. You can even switch on the fly. In case you’re wondering, yes, we do have three monitors setup for all the developer machine in the office :)

VMWare-Workstation-Multiple-Monitor-Support

The final feature is significant enough for our story to warrant a paragraph of its own. I accidentally stumbled across it this morning when I upgraded VMWare to version 6.5.

Remote Debugging Support in VMWare

You read my earlier steps to get remote debugging working which will work for any sort of virtual environment. VMWare however brings some nice debugging features to the table available right there in Visual Studio.

1) Goto the menu VMWare and select Attach to Process.

VMWare-Workstation-Debug-in-Virtual-Machine

2) Select the VM you want to start debugging on and point to the Remote Debugger that you’ve got locally in \program files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86.

VMWare-WorkStation-Attach-to-Process-in-Virtual-Machine

3) Click the Attach button and the Remote Debugger will launch inside the VM and you’re ready to debug.

No need to copy anything to the VM. It just works. You can even setup a config for this which enables you to attach to the debugger with F6. Nice!

In conclusion running Visual Studio outside of the VM is not only possible but with the right tools like VMWare in hand it’s even an enjoyable experience. Have fun!

posted on Tuesday, November 11, 2008 10:35:21 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, September 13, 2008

ReSharper-Logo I was fortunate enough to attend a special event at Trifork at which the manager, Oleg Stepanov, of the Jetbrains team creating ReSharper gave a talk on ReSharper functionality. He basically demoed a bunch of R# features most of which are pretty well known to the Vertica team and myself but a couple of nuggets did present themselves and I figured if we don't know about them probably others don't as well.

Please note that all keyboard shortcuts mentioned in this post are based on the standard R# Visual Studio keyboard layout.

Smart Code Completion

On the light side I'll start with a feature I knew was in there but I never quite got why it was useful. The feature in question is smart code complete or as I like to thing about it Smart Intellisense. You find the feature in the ReSharper menu under Code > Complete Code > Smart (CTRL + ALT + SPACE). Smart Code Completion is basically smart intellisense, you could say that it puts the "intelli" in the intellisense :)

What it does is that when you activate the feature it suggests methods and properties based on the types in the local scope. So if you're in the process of assigning an int variable from somewhere it will only suggest methods based on matching return types, not just name as is the case with standard Visual Studio intellisense. Check out the screenshots below, the one to the right is standard Visual Studio intellisense (CTRL + SPACE), the left one is R# Smart Code Completion where the list is greatly reduced.

ReSharper-4x-Smart-Code-Completion-Normal-Intellisense  ReSharper-4x-Smart-Code-Completion 

Complete Statement

Probably the most useful feature that I picked up at the meeting is Complete Statement. Complete Statement is available from the R# menu under Code > Complete Code > Complate Statement (CTRL + SHIFT + ENTER).

It bascially tries to complete the current statement that you writing so if for example you're writing a method signature you and you use the feature it will complete the method signature and move the cursor to the method body enabling you to write your code in a more fluent manner. It works in a number of situations so you really want to learn the shortcut and start experimenting with it.

Complete Statement for if-statement. First step inserts the missing parenthesis and the curlies. Second step moves the cursor to the body of the if-statement.

ReSharper-4x-Statement-Completion-If-Step1  ReSharper-4x-Statement-Completion-If-Step2 ReSharper-4x-Statement-Completion-If-Step3

Complete Statement for method signature. Inserts the curlies and moves the cursor to the method body.

ReSharper-4x-Statement-Completion-Method-Step1 ReSharper-4x-Statement-Completion-Method-Step2

And for a string variable. Inserts the semi colon and moves the cursor to the next line.

ReSharper-4x-Statement-Completion-string-Step1 ReSharper-4x-Statement-Completion-string-Step2

Generate in Solution Explorer

You probably know about the Generate feature in Visual Studio which enables you to generate properties, constructors, etc.. What I didn't know about this feature is the fact that it's also availble in the Solution Explorer and basically enables you to create a class, interface, struct, or folder. Very handy indeed.

Generate is available from the R# menu Code > Generate (ALT + INS).

ReSharper-4x-Generate-In-Solution-Explorer

Camel Case Navigation

I love the code navigation features of R#. They let me find my way around a code base very simply. I've found this particularly useful in code bases I don't know very well because I usually have an idea of what another developer might choose to call something so I just go look for part of that type name. Anyway a twist on the navigation features is the fact that you can navigate via Camel Casing so if you have a type named OrderManagementService you could look for it by typing the entire thing but with Camel Casing you basically enter the upper case letters of OrderManagementService (OMS) and it will find that type for you. Very handy and my second favorite new feature of R# :)

BTW Navigate to Type is CTRL + T, Navigate to Any Symbol is CTRL + ALT + T, Navigate to File Member is ALT + <, and Navigate to File is CTRL + SHIFT+ T. Learn 'em, love 'em.

ReSharper-4x-Navigate-by-CamelCase-Standard ReSharper-4x-Smart-Code-Completion

Coming Features

Oleg also told us a little bit about what we can expect to see in R# 4.5. The main "feature" of the 4.5 release is performance tuning and bringing down the memory footprint. They're look at speeding up R# by a factor 2 and bringing down the footprint by 100 mb. Certainly very welcome. They are sneaking in new features though and one of them is to include "Find unused code" in Solution Wide Code Analysis.

Download ReSharper 4.1

posted on Saturday, September 13, 2008 3:37:02 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, September 08, 2008

evil-insideWhen first I saw the var keyword in C# 3.0 I was excited, my body tingling with excitement for the possibilities this keyword would bring to the world of many a .NET developer: Productivity, clarity, fame, and fortune. Unfortunately now that C# 3.0 has been with us for a while I feel that I must warn the public of the evil that is the var keyword. Productivity, clarity, fame, and fortune have succumbed to mind boggling spaghetti code, confusion, and lets be honest fame and fortune were never really on the table to begin with :)

What then is this evil of which I speak? Massive overuse of the var keyword. Observe the following hot dish of spaghetti bolognese:

   1:  public void SpaghettiBolognese()
   2:  {
   3:      var calculator = new Calculator();
   4:      var taxLevel = GetTaxLevels();
   5:      var person = GetPerson();
   6:      var tax = calculator.CalculateTaxLevel(person, taxLevel);
   7:   
   8:      person.Tax = tax;
   9:  }

All kidding aside this piece of code breaks one of my most fundamental rules when reading and writing code: Don't make me think. Grokking a piece of code is though enough as it is having to keep types and varibles in memory (read: the developer brain) will slow down the process of code reviewing or debugging a piece of code.

For now I'm using a couple of rules to keep the var silliness at manageable levels.

1) Always use proper types for variables which are set from a method or property. It makes the code so much more readable.

   1:  Tax tax = calculator.CalculateTaxLevel(person, taxLevel);

2) Do use the var keyword when there is no question about which type it will be inferred to.

   1:  var calculator = new Calculator();
   2:  var i = 100;
   3:  var s = "Søren";

While the var keyword does offer a nice productivity gain it's important to realize when to use and more importantly when not to use it. Also it would seem that the var keyword is in cahoots with the good folks at Jetbrains as ReSharper is very eager to convert perfectly well formed type declarations to implicitly typed ones. As I started out by saying be wary of the var keyword - it's one sneaky bastard :)

Var-keywords-is-a-sneaky-bastard

posted on Monday, September 08, 2008 9:57:14 PM (Romance Daylight Time, UTC+02:00)  #    Comments [10] Trackback
# Tuesday, May 13, 2008

aspnet During my ANUG talk about the ASP.NET MVC Framework a question came up regarding what the landscape of ASP.NET land would look like with ASP.NET MVC being open source. Would we start to see lots of different branches floating around out there?

The answer to this is a resounding no as the license model of ASP.NET MVC only allows for you to download the code off of CodePlex, make changes, but not redistribute those changes.

What this means that you'll be able to take the code make tweaks here and there if you're not satisfied with how a particular aspect of ASP.NET MVC works.

The Gu has the word.

posted on Tuesday, May 13, 2008 9:23:26 AM (Romance Daylight Time, UTC+02:00)  #    Comments [4] Trackback
# Sunday, January 13, 2008

I'm starting to look into the ASP.NET MVC Framework and needed to download the CTP just now which is not all that interesting. What is interesting though is the fact that I was greeting with a dialog asking me whether I wanted to try the new Silverlight version of the MS Download site. Naturally I couldn't resist :)

Check out the MS Download Center beta done in Silverlight.

posted on Sunday, January 13, 2008 2:42:45 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, November 23, 2007

I had a problem today where a file exported from a system was showing up correctly in my text editor but whenever I tried to re-import it elsewhere my special characters where messed up; ÆØÅ showed up as garbled characters.

Of course the reason for this is the fact that the export sets an old code page on the file which isn't recognized by the receiving system so I simply had to change the code page of the file.

My instinct was to go with UltraEdit but I didn't have a license around so I thought that Visual Studio probably would get the job done for me and it did but it isn't too obvious how to do it; not that UltraEdit is intuitive in this area either :)

  • Open the file in Visual Studio.
  • From the file menu select Advanced Save Options
  • Select the code page

Visual-Studio-Advanced-Save-OptionsVisual-Studio-Advanced-Save-Options-Dialog

posted on Friday, November 23, 2007 11:32:44 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, November 22, 2007

visualstudio_logo I've often wondered how life as an add-in developer for Visual Studio is like. On one hand you have the power to create tools and utilities which will benefit you greatly in your everyday life and you get the added benefit of geek-cred if you do your job really well.

On the other hand though we've got Microsoft who for any given release of a product can annihilate your entire market simple as that. In the same stroke they create markets simply by making stupid mistakes so it's really a double edge sword when you're working in semi-competition with Microsoft.

I think the newly released version of Visual Studio 2008, ah 2005 I hardly knew you, is a shining example of that however small the example is.

TestDriven.NET an add-in which has proven very useful to me, particularly for a single function: Run Test in Local Scope. Basically it allows me to execute the test I'm currently in with a shortcut and you know that I'm all about the shortcut driven development :)

Visual Studio 2008 introduces unit testing features in the professional version for the first time ever and with it a nice addition which does exactly what I've used TestDriven.NET for in the past: Run Test in Local Scope. It's even bound to the same shortcut that I chose myself when I configured TestDriven.NET the very first time. Just go CTRL + R + T and your test will execute. W

With a single stroke of genius Microsoft has taken away my need to install a third party add-in in Visual Studio 2008 by providing me with exactly what I need out of the box. Of course the feature only works with MSTest which will be a problem for all you xUnit users out there but we've run with MSTest for a while now making it a perfect fit.

MSTest-Run-Tests-In-Local-Scope

Oh yeah - Microsoft released Visual Studio 2008 this week :)

posted on Thursday, November 22, 2007 8:33:30 AM (Romance Standard Time, UTC+01:00)  #    Comments [2] Trackback
# Wednesday, October 10, 2007

You're probably already heard the buzz about Microsoft releasing the code for the .NET Framework. I've held my tongue on this subject for a while because I wanted to formulate my own opinion on it instead of just doing the obligatory YAY-post. My stance on the subject is not as glowing as others I've seen during the past week.

In many ways I'm more excited about the new MVC framework than I am about the release of .NET Framework source code. Sure it's great to be able to step into the implementation of some class from the BCL but we've had that ability forever with Reflector. It's not THAT often I've had to bring out the big guns to debug a problem; in 99,9% of the cases the problem is not with the framework itself it's with our custom code. I fear that some people will start hunting for bugs in the framework instead of sitting back and actually considering the bug they're seeing before trying to debug it.

I'm not sure that the problems with patent infringement as outline in this post will be a problem but it certainly is something to keep in mind with the litigious environment in the United States.

I don't mean to belittle Shawn Burke's effort because he certainly did a very cool thing in getting this thing out there and he's been working on it on and off for a long time. He actually blogged about it the first time back in 2005 albeit in a less ambitious scope also check out his follow-up about the actual release. Much more interesting is the fact that the system they've set up will work for any product group which want to release source for their particular product; we probably won't see the source code for BizTalk floating around out there but there certainly are some interesting implications in this if their idea is carried beyond the framework itself.

What I like about this new development is the fact it's a manifestation of a more open and transparent Microsoft, we've seen it for a while now that the company is more open via the blogs and more recently with the open source announcements for ASP.NET AJAX Control Toolkit and IronRuby. The idea that Microsoft would release source code a few years back was preposterous but now we're seeing much more effort to support the community around the products which in turn I'm sure will bleed into the community itself and create more open source initiatives on .NET than what we have today.

posted on Wednesday, October 10, 2007 9:30:57 AM (Romance Daylight Time, UTC+02:00)  #    Comments [3] Trackback

I first heard about the new MVC paradigm for ASP.NET coming form Microsoft at JAOO when Oren Eini mentioned it at the MonoRail talk at JAOO. At the time not much information about the new frontend framework was available but with Scott Guthrie's announcement of it at ALT.NET information is starting to trickle out. Scott Hanselman has even more information on it including full presentations of actual code from the conference (done in Silverlight naturally).

While MonoRail has taken these ideas and run with them for a while it's great to see Microsoft stepping in with their own implementation as I strongly believe that that is the only way to create the adoption rates needed for people who need to get their job done.

I'd like to adopt a framework like MonoRail but in doing so I'd effectively cut customers and team members from access to third party controls built for WebForms and even worse we'd have to invest heavily in training new hires on MonoRail before they can effectively participate in projects when in fact I could spend that time training them on technologies which effectively bring much more value to the table like Commerce Server and SharePoint.

posted on Wednesday, October 10, 2007 9:05:21 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, September 26, 2007

jaoo2007_1 I wanted to know more about alternative web frameworks out there. One such framework is MonoRail which is part of the Castle project like ActiveRecord which Oren and Hamilton spoke about yesterday.

MonoRail is a web framework which uses MVC and is built on top on ASP.NET. ASP.NET != WebForms. WebForms technology is built on top of ASP.NET like MonoRail and includes ViewState, life cycle, page structure, etc..

MonoRail was inspired by Ruby on Rails' Action Pack. It's not a direct port, however, it has its own identity and is not opinionated like is the case for Ruby on Rails. The mail goal of MonoRail is to separate concerns and getting rid of repetitive and tedious code. Controller => Model => View => User input => Controller.

Like with ActiveRecord a wizard is triggered when you create a new MonoRail project, also including the test project for TDD purposes. A lot of stuff is generated when you create a new projects just like you'd see in Ruby on Rails. Everything is spliut in Content, Controllers, Models, and Views folders. Content is for CSS, Javascript, stuff like that. The controllers folder is subdivded into a folder for each concrete controller.

All Controllers inherited from BaseController and has a number of Actions which are basically instance methods. View Engines. MonoRail has a number of ways of writing views, the default is NVelocity. You simple and complex ViewEngines, Brail for example allows for Boo code and the full power of .NET in the UI while NVelocity only provides a simple if statement. Layouts are outer views, the inner view is what the controller deails with. You specify the layout by way of attribute. The lauout contains the actual HTML while the inner lauout contains the dynamics parts of the UI. Filters is code than runs before or after specific pieces of code, e.g. you can use filters to change the theme of a site. Again attributes are used for associating the filter. Helpers is something that is made available to your View and abstracts away common HTML snippets, e-g- $Url for creating links. ViewComponents is a more elaborate way of creating stand alone controls.

SmartDispatcher allows you to bind the actions of a form directly to an Action (a method) on the controller, you only have to inherit from a different basecontroller to have this work. FormHelper and the DataBinder are for creating complex forms and you use them to bind to a specific class. You use the an attribute in concert with FormHelper to state what your type is called and to bind to HTML by $Form.TextField("customer.Name") and then you automatically get the customer served up with the correct values once you post back. Automatic Form-Validation is done by decoating the properties of a particular class with validation attributes. To trigger validation you simply say so on the action.

Combining the rest of Castle to Create Enterprise Applications. Castle is full of independent projects you can use the parts you like. The Windsor container is the most advanced of the bunch in comparison to Spring.NET, ObjectBuilder, NInject etc.. Castle Facilities provide integration to other products like IBatus, ActiveRecord, and more.

MonoRail is an organization of services. If you want to change the way MonoRails handles things you can change the corresponding service.

Not as well documented as WebForms. Has a learning curve. No designer support. It is easy to fall into the pit of success because MonoRail leads you in the direction of good design. Microsoft is working on something similar for the future and it should be about to be released in beta.

What does all this boil down to then? to my mind there are a lot of very good ideas in MonoRail but it seems to me that there are a lot of nook sand crannies to know before you get going. Oren's argument against this was that in the long run you will benefit from MonoRail because it makes it easier to fall into the pit of success. I certainly agree with that but there are a number of draw draws that I see. You loose the ability to do anything with SharePoint for example because it operates in the WebForms world, also you loose a lot of third party controls which are also built for the WebForms. It's encouraging to me that Microsoft is working on something similar because that will garner the widespread support needed to grow a third part business around a web framework based on the MonoRail principles.

posted on Wednesday, September 26, 2007 10:38:16 AM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Tuesday, September 25, 2007

jaoo2007_1 Last session of the day is actually the one I'm looking forward to the most: How to brandish LINQ to SQL in a domain-driven design environment? I have some ideas of my own of course but I'm looking forward to stealing some from a couple of industry experts on the subject :) A little about Kim Harding. He's sold his part of Trifok and has founded a new company called Lystfisker.TV and does consultancy on the side. Jimmy Nilsson is of course the auther of a couple of DDD books.

Kim and Jimmy has two different ways of working with the product: Kim works more with the graphical designer where Jimmy starts with the code.

Avoid Anemic Domain Models which are data centered and very light on behavior. With this kind of model the behavior is usually found in transaction scripts instead of in the model itself. Queries often contain domain knowledge - they are just words without meaning in LINQ. The same query might be sprinkled many different places in the code. They have a VideoStore example they've implemented which includes a number of design patterns, associations, and aggregations.

Main focus of DDD is to work with the core of the applications and forget about distractions, don't worry about implementation details. Keep business rules separate from plumbing, e.g. keep data access code apart from business object. One of the main problems for a DDD process is that we have to deal with a relational database at some point; we need a way to bridge the gap between OO and ER and that is where LINQ to SQL comes into play. We like to start by creating the domain model and have the database take the backseat.

DDD is all about the ubiquitous language that we as developers share with the domain experts, it is developed with the domain experts in order to gain a shared idea of what we're trying to do. Many Entities are not fundamentally defined by their attributes, but rather by a thread of continuity and identity, e.g. the unique id. ValueObjects have no conceptual identity. These objects describe some characteristics of a thing, e.g. Address and Price. We can create a language from ValueObjects. An Aggregate is a cluster of objects that go together for data changes, e.g. Order-OrderLine. Repositories work as a starting point for a traversal to an entity in the middle of its life cycle; it has a collection-like interface.

Specification is used to express a business rule as a first class concept, i.e. a class. We can use it for validation, e.g are you satisfied by this validation and querying, e.g. retrieve all objects for query.

ISpecification<T>.isSatisfiedBy(T anObject)

UnitOfWork encapsulates the work we're going to do and describes the context we're working in.

UnitOfWork.Create<Repository>

Add to repository

Complete UnitOfWork

IUnitOfWork, IRepository, ISpecification<T>, LambdaSpecification<T>, IEntity<T> (T is used for key), IEntitySet<T>

Use specification as a query mechanism as well.

Good and bad about LINQ to SQL  when doing DDD; Very powerful for example regarding specifications. Makes it simple to develop. Generates very nice SQL.

Don't like lazy loading requires extra attention in the domain model classes (EntitySet). Default ctor is required. Readonly keyword can't be used. Problems with value objects are not supported in LINQ to SQL which is a problem because they are extremely important in DDD. Work around exists for value objects you can add the value object to another partial class which will be joined the class generated by LINQ.

We able to work in several different ways: We can start with a tables first approach, a diagram approach, or a classes first approach. However working with the classes first doesn't seem to be the main focus of the LINQ product. Diagram approach generates a lot of code. Classes don't follow convention over configuration everything is opt-in, counter argument is that with the designer everything is generated for you. You can have LINQ generate the schema automatically but you can only create and recreate the entire database. DataLoadOptions is used to describe what should be eager loaded but it can only be defined once per entity and context. LINQ to SQL was not designed for DDD but more for when you have an existing database. Leads to Anemic Domain Model because you get in the mode of scattering queries all over the place.

In conclusion LINQ to SQL looks like a good product and a step in the right direction but will be an eye opener for many developers doing DDD.

 

Streamlined Object Modeling book recommended.

posted on Tuesday, September 25, 2007 6:01:25 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback

jaoo2007_1 Developers != plumbers is a saying that Anders Hejlsberg has. We are spending too much time translating between multiple paradigms, be it XML, SQL, or objects. LINQ is the answer to this problem. We have two parts of LINQ that go to the database: LINQ to SQL and LINQ to Entities with LINQ to SQL as the simplest way of going to the database. LINQ to Entities is intended for the enterprise and provides more mapping features. LINQ to SQL works for both SQL Server 2000 and 2005.

So how does LINQ to SQL work? You basically write your query in the application and when you enumerate the query it will be converted to SQL and executed against the database. Adversely when you update everything is stored in the DataContext and is sent to the database on a call to the method SubsmitChanges.

How do you map a class to a table? You create your class like you would normally and decorate it with attributes. For a class you specify [Table(Name = "TableName"]. For properties you specify [Column] and additionally specify which property is the primary key like so [Column(IsPrimaryKey=true)]. Optionally you can store the mapping information in an XML file, though for simplicity and less errors keep the mapping info in attributes. No special base class is needed for the magic to work.

With the mapping done we create a strongly typed database context by inheriting a different class from DataContext where you can specify your tables. Running a query against the DataContext is where the mapping magic happens. You simply do a

var query = from c in db.Customers;

foreach ( Customer c in query ) // mapping magic happens here, not using the Table<Customer> type but the Customer type

{

// do stuff

}

Adding a where-clause will cause all the parameters in that clause will be generated to SQL parameters in order to avoid SQL injection. Generated queries are kept as simple as possible as to not confuse developers. Performing a select you can represent relationships which you cannot do in SQL; with SQL you can do only a flat resultset but with LINQ you can get back more natural OO hierarchies as results which are easier much to work with. The LINQ query language is a more expressive language than SQL and as such you are able to express every SQL query with LINQ. Only the properties you actually ask for are returned by the generated SQL query which is nice.

As an alternative to the attribute mapping you can use a graphical designer which allows you to drag and drop tables from the server explorer. It then creates the classes for you. the tools allows for overriding the generated values for the class name and various other stuff. It also allows for mapping to a stored procedure. Relationships are inferred from the database schema so get those foreign key constraints in place today :) Usually relationships are expressed by the object graph but in some cases the link is missing so you'll have to crack open the JOIN functionality of LINQ to get your job done.

One piece of LINQ to SQL that I'm not particularly fond of is the fact that interface based separation is not supported right out of the box so you need to enforce something like the Repository pattern and not allow direct access to the DataContext if you need that kind of separation.

Updates and deletions are very easy to work with. You basically update and create new instances of your objects like you would normally. When creating a new instance you also need to add it to either the DataContext or to the parent object to which it belongs. The only difference is that you must remember to call SubsmitChanges on your DataContext. Concurrency is handled via optimistic concurrency is used for updates, errors are raised if you encounter changed data. Autogenerated values like identities are automatically populated from the database into the object. If you want to use a stored procedures for selects, updates, or inserts you can configure a stored procedure to do so by modifying the behavior of the object in the designer. You simply drag the stored procedure you want to use into the designer and then configure it for the particular object. With the stored procedure is dragged into the designer you can also optionally call it directly on the DataContext.

For stored procedures returning a resultset you will default get a new type generated for the resultset of the proc. What's very cool is that you can configure the proc to not use the generated type and use a domain type instead. Additionally you can perform a query on top of the resultset returned by a stored procedure, something that is impossible with straight SQL.

An interesting feature I noticed in Visual Studio 2008 during the demo is a document preview when you're switching between open documents in the environment. Should make it much easier to find the particular code file you want.

Funny guy.

posted on Tuesday, September 25, 2007 4:50:48 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

jaoo2007_1 Castle Project is an open source project created to make developers more productive and have more fun and enjoyable work. In the end to create a more maintainable app. Castle Projects consists of ActiveRecord, MonoRail, MicroKernal & Windsor (IoC containers like Spring.NET), Castle Contrib (people contributes here).

Common persistence approaches include spaghetti persistence with databinding in the UI, good for demoing, architecturally it's probably the worst way to do it. Second approach is ad hoc persistence where you write a stored procedure or SQL statement and use those directly, no fixed way of doing DAL. Next step is to have the DBA to handle persistence which leads to a lot of overhead in getting things done. After that we move to hand coded data mapping layer, the problem with the hand coded layer is that it's boring plumbing code. The answer to all these problems is an ORM where everything happens via a generalized framework.

Castle ActiveRecord is a framework which makes ORM really simple by abstracting away the complex stuff. ActiveRecord is built on top of NHibernate and leverages the work done there in the past. ActiveRecord maps to a row in the database. Attributes are used to map objects to tables.

Installer will create template projects in Visual Studio which will trigger wizard upon creating a new AR project, it will generate a main project and a test project to pull you in the right direction right off the bat. You then create your class like you would normally with properties and fields. By decoration the properties you start mapping the class to the database with the [Property], [PrimaryKey], [ActiveRecord] attributes. With the mapping done you need to set up the database context which will provide access to the actual database backend by instantiating the ActiveRecordStarter class. If the table you mapped to is not available you can have AR create the table for you automatically. This makes refactoring of the code and the database very simple because everything happens in Visual Studio instead of having you to go to both code and the database.

Relationships are where it starts getting complicated but AR has a way of dealing with this in an easy fashion as well. By adding a single attribute ([BelongsTo] / [HasMany]) to the link property AR will be able to figure out the relationship between two classes. AR will again generate the schema like before with the simple example of a single table.

Querying is handled by NHibernate query language (HQL) which is an OO query language. Unfortunately the queries are done in strings in the code. For an even better better approach you can use a fluent interface to express your queries in an intellisense supported manner. The fluent interface approach is a very nice way of doing querying because it produces a clean and readable code. Oren spoke about this very thing yesterday in his DSL talk.

Integration with Lucene.NET is provide out of the box which means that you can take any entity, index it, and do a full-text search on the object. Inheritance is another area which traditionally creates some interesting problems for us when doing ORM. AR supports this by doing join tables. AR provides validation ala what is found in Enterprise Library. You simply decorate your properties with attributes like you do when doing the mapping. Basically you can go nuts with this and doing all your validation in code rather than specifying the rules in the database.

Domain driven design is supported, you don't need to inherit from the special AR classes to get the thing going; instead you can use the Repository pattern. ActiveRecordMediator facilitates this approach. Lazy-loading is supported which is good news if you have rich object graphs in your application. Multi-level caching ensures that objects are only loaded once, basically the same concept as the DataContext in LINQ to SQL. You can even do distributed caching which I'm not sure is available in LINQ.

NH Query Analyzer is a tool like Query Analyzer from SQL Server...

No stored procedure support for CRUD. LINQ for NHibernate is under development and will go live within the next five to six months. Active development will proceed after this time as well so that's definitely good news.

posted on Tuesday, September 25, 2007 12:02:47 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

jaoo2007_1 The keynote this morning was quite interesting as Erik Meijer detailed to us how he sees the future of software development from a technology perspective. Erik Meijer is oding research which according to him may allow us to defer important architectural decisions to a much later point than is possible today. His vision is to allow us to create applications without thought for the deployment scenario, they should just work based on the capabilities on the client. What this means is that in the future we might not have to select a web project over a winforms project. In essence this is deferred to either runtime or deployment. Enabling this is technology which will go into compiled IL and convert it to the which ever platform you wish to deploy to, adapting your code automatically to run on the platform you choose. He showed a couple of examples of this: UI and 3D. The UI part is not what I'd call trivial but he really blew my mind when he started talking about 3D. 3D is basically not a problem with technologies loike Flash and WPF but do you do when you need to support in DHTML? He showed an example of doing just that; they'd taken a model of a teapot and basically created than in pure DHTML using only CSS and DIVs, very impressive. Of course Javascript is no way near powerful enough to pull off a real time rendering but as we all know coding for the present is not the way to go, we need to code for the future and that's what they're placing their bets on.

Erik also mentioned parallel computing, a topic Anders Hejlsberg alluded to as being his next project last year at a TechEd 2006 in Barcelona. LINQ is basically a DSL for working with sets and as such is highly parallelizable. Interesting to hear that that particular project is moving forward.

I surely hope that Erik will be able to deliver on his project with regards to deferring platform to deployment but I fear the kind of autogenerated UIs we're going to see. No doubt a UI can be generated but different design paradigms exist for the web and the desktop are very different and as such I fear that it just won't work just porting the UI to the various target platforms.

posted on Tuesday, September 25, 2007 10:37:50 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, July 27, 2007

My Solution Explorer that is. Duckie put his Solution Explorer online and I though it would be fun to show a couple of our projects. The first one is a warehouse management system which handles everything from incoming goods to picking and getting the goods out the door again.

eLog-Solution-Explorer 

Next up a service oriented solution for e-commerce or rather part of it. Easily the most complex of our solutions with loads of projects it's even got a REST based interface for integration purposes with older parts of the system. I'm particular proud of this solution because it incorporates heavy use of automated unit- and web testing. Notice the use of solution folders to keep projects for the individual services together.

 SOA-Solution-Explorer

posted on Friday, July 27, 2007 9:28:09 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Sunday, July 01, 2007

... Actually it's been out a couple of days but I wanted to take it out for a spin before posting about it.

Licensing

Users of the previous version need to be aware that this release is not a free upgrade from 2.x like we've been used to. Existing customers can upgrade their license for $199 while a brand spanking new version will set you back $349. It worth nothing that when you upgrade your existing license you actually get a completely new license for 3.0 something Microsoft should sit up and take notice of considering their annoying scheme of installing Windows Vista and then installing the "upgraded version" on top of that. It reminds me takes me back to upgrading Windows 2000 to Windows XP but that's a different story for another time :)

Additionally JetBrains has created a richer licensing model with separate versions for C#, VB, and a full version with support for both of them. Yes, you read that right, JetBrains now has VB support in ReSharper. More on that later.

JetBrains has really gotten their act together this time around and have released ReSharper 3.0 with Orcas support ahead of the final version of Orcas. I still member when Visual Studio 2005 was released and we had to wait for months and months until they got a ReSharper version out the door with support for that version.

Keyboard Scheme

ReSharper-Keyboard-Scheme-Selector When you first fire up Visual Studio with ReSharper 3.0 installed you will be greeted by my favorite new feature: The ReSharper Keyboard Scheme selector. Basically it allows you to select the keyboard scheme with which you are most comfortable like we've been doing in Visual Studio forever. It addresses one of the pain points I've had with ReSharper since version 1.0: The default shortcuts overrides the ones I'm used to in Visual Studio forcing me to remap keys or keep and exported file with my settings handy. When dealing with shortcuts I usually conform to the default layout of the keyboard just to avoid having to remap keys on every installation of Visual Studio I use. As of today I have 4 - 5 separate installations: One for the laptop, one for the desktop, one for a number of virtual machines... basically a lot of environments to keep in sync which is a pain when you're so dependant on the keyboard as I am.

Polish

The product has gotten a lot polish compared to the previous version. Just take look at the settings dialog which will also give you an idea of the scope of the product. Another testament to this fact is that when you install ReSharper you have the option to hide UI elements in Visual Studio which are redundant because ReSharper offers better functionality. Case in point the Refactor menu item on the Visual Studio toolbar which is removed in favor of the ReSharper menu item because that item encompasses so much more than Refactor. Of course this is configurable as you can see on the settings screenshot.

ReSharper-30-Settings

VB Support

JetBrains has spent a lot of time adding support for VB which is great for people doing work in VB. For myself it's a nice to have feature because we do have a couple of projects created in VB still and more importantly projects which mixes and matches VB and C#. I would have liked to I would have been more grateful for the feature two years ago but still it's nice to have the feature I'm used to available to me in both C# and VB. Additionally support for XML and XAML has been added to this version.

TODO Explorer

The TODO explorer (CTRL + ALT + D) is another new addition which actually makes our //TODO comments useful again. I've tried to use TODO comments in my code but I always forget to look them up. I'm sure that Visual Studio provides some sort of UI for viewing a list of TODOs but I can't for the life of me remember how to access it. The TODO Explorer in ReSharper makes it easy to get an overview of the TODOs in your code and ReSharper itself reformats TODO comments in a fashion that makes them stand out more, a nice visual cue that something needs to be done.

ReSharper-30-TODO-Explorer

File Structure Window

I found the File Structure explorer (CTRL + ALT + F) by accident when I was trying out version 3.0 so I'm not sure whether it's a new feature to ReSharper 3.0 or if it's been there all along. It's new to me at least :) Basically it gives you an overview of the structure of the file you currently have open in Visual Studio. Very handy to make jumping to specific stuff in a file easier. Both the File Structure and TODO Explorer are naturally dockable like you would expect.

ReSharper-30-FileStructure

Background Compiling for C#

VB offers a feature called background compiling which is very useful because it provides feedback without compiling. When Vertica initially started out we were using VB because everybody came from an ASP 3.0/VBScript/VB6 background which made the choice to go with VB a nobrainer. When we switched to C# a couple of years later the feature I missed the most from VB was background compiling. In fact I was so used to the feature that C# and Visual Studio felt "wrong" somehow; I weren't able to put my finger on it until later when I dug a little and found the background compiling feature of VB. ReSharper offers much the same feature and improves upon the capabilities offered by Visual Studio itself by adding a nice overview of errors in the current file. Notice the right side of the screenshot where a yellow square and a couple of red and orange bars are shown. The square indicates the overall status of the file, the red color means that the file doesn't currently compile. The bars indicate where the errors and warnings are located in the file.

As a nice addition you can scroll through errors (SHIFT + ALT + PgDn / PgUp) and highlights (ALT + PgDn / PgUp) via keyboard shortcuts making it easy and efficient to fix errors.

ReSharper-30-Background-Compiling

Context Actions

ReSharper offers another interesting feature which is the context based action (CTRL + Enter). Basically it tells you what the allowed operations at any given point are. Very handy when you're learned the product and don't know all the shortcuts. ReSharper is very keyboard driven which makes it the perfect fit for most C# developers but this is one area where they bring some of the stuff I think VB developers are going to like.

ReSharper-30-Context-Action

Refactoring

In previous versions of ReSharper you would have to learn shortcuts for every refactoring which meant, for me anyway, that I took the time to learn the most useful ones and left all the other ones alone. Not anymore. As an extension to context based actions we have Refactor This (CTRL + SHIFT + R) which brings up a list of available refactorings based on the place your cursor is at in your code. What this allows for is a single entry point into refactorings allowing you to get familiar with the various possible refactorings and ultimately to use them more than you would otherwise.

RESharper-30-Refactor-This

Type Completion

Type Completion adds a new level of intellisense to Visual Studio. Basically I can type a partial type name bring up Smart Code Completion (SHIFT+ ALT + Space) which will search through all reference assemblies and suggest type names even without a using statement of the namespace the type is in. Pressing enter will add the using clause to the top of file as well as complete the type. I can't say too many good things about this feature; it simply boots my productivity because I don't have to hunt around for the right namespace.

RESharper-30-Type-Complete

Unit Testing

If you're into unit testing (and you should be :)) ReSharper has something to offer as well. You'll be able to execute your tests from within Visual Studio ala what TestDriven.NET provides and additionally you get an Unit Test Explorer which makes it easy to overview your test suite. Basically ReSharper allows for much of the same convenience as Team System does by integration xUnit frameworks into Visual Studio.

Bracket Completion

Everything provided by ReSharper is about better productivity. In this section I'll cover all the little things you'll love and get addicted to before you know it :)

Bracket completion basically puts in the closing bracket of a block. Type { and ReSharper adds the matching }. Same thing goes for parentheses. You only save a keystroke but think about all the times a day you actually need this feature. I can't live without this one for sure.

Smart Complete Code

Smart Complete Code (CTRL + ALT + Space) basically an evolved version of Intellisense which gives you more relevant completion than what Visual Studio provides. You can think of the feature as scoped intellisense, whatever is relevant for the scope you're currently in ReSharper suggest. Very handy.

Reformat Code

Reformat Code (CTRL + E + F) is an extension to what was introduced in Visual Studio 2005 where you can specify how your coding style is, i.e. how spacing works, line breaks, all that good stuff. ReSharper actually had this in versions before Visual Studio 2005 came out and 3.0 has even richer support for configuring your coding style. Additionally you can reformat the code of the currently open file and as two new options globally for the entire solution or silently so you don't have to choose which settings to reformat by every time.

ReSharper-30-Coding-Style-Settings

Surround With

Imagine that you've written a block of code and you are reminded that you need to do a try-catch around that block of code. You laboriously move the cursor to the start of the block and type try followed by the brace. After you you move the cursor to the end of the block and do the catch maybe followed by a finally block. With ReSharper that operation would go something like highlight the code block press CTRL + E + U select surround with try-catch-block. Surround With is a feature that allows you to surround blocks of code with other code like the try-catch block, a region, an if-statement, and so forth. I use this feature extensively to surround block with regions for example.

ReSharper-30-Surround-With

Goto Usage

How many times have you wanted to know which pieces of code call the particular method you're currently looking at? I know that I daily want to see this and luckily ReSharper does provide exactly this feature (SHIFT + ALT + F12). If only a single usage is found the you're taken there otherwise a list of the usages is displayed.

Summary

With the job market being what it is today my opinion is that it's downright irresponsible to not use tools that boost the overall productivity of developers. Almost every single company is clamoring for developers instead of making the most of the developers already employed in the company. Visual Studio brings a lot of productivity to the table, nice designers, code snippets, background compiling, refactoring. Even innovations in the core framework are about productivity like LINQ, automatic properties, etc..

ReSharper takes many of these familiar tools to new levels and adds new functionality to the best development environment out there. I've been using ReSharper for years and have liked almost every version of the product with exception of 2.0 which was dog slow. I'm happy to report that all the code analysis going on behind the scenes don't slow down Visual Studio noticeably. ReSharper truly delivers on JetBrains' promise of "develop with pleasure".

posted on Sunday, July 01, 2007 9:32:19 PM (Romance Daylight Time, UTC+02:00)  #    Comments [6] Trackback
# Monday, June 18, 2007

A quick reminder that the first meeting of the Aarhus .NET Usergroup is this wednesday 19:00 at Hostnordic A/S, Åhavevej 5, 8260 Viby J. Check out my original post about it and also take a look at the attendee list. I'm taking the liberty of proposing an agenda for our initial meeting to try and encourage a more productive meeting.

Goals for initial meeting
Vision/Mission for the group
Elect core responsible for group
Website

Who are we
Introduction of attendees
Wishes for the usergroup - advanced topics vs. entry-level topics
Brainstorm for content - concrete presentations

Physical space
Schedule meetings, e.g. the last Wednesday of every month
Venue for meetings, e.g. round robin of work spaces
Informational web site

Content
Attendees wishing to do presentations
Contacts in companies (possible speakers)
Content topics: SQL Server Express, SSIS, ERP, Vista, Commerce, Ruby, BizTalk, data access, LINQ, architecture, concrete projects
INETA
Use of Prosa/Samdata

posted on Monday, June 18, 2007 3:48:12 PM (Romance Daylight Time, UTC+02:00)  #    Comments [3] Trackback
# Wednesday, June 06, 2007

Earlier this year there were some rumblings that a .NET usergroup would be started in Århus, Denmark. Nothing ever came out of it but this time around I do think that we have something. Quite spontaneously too by the looks of it.

If you are at all interested in talking to like-minded .NETers now would be a good time to show up for some community service :)

The date is set for June 20th 1900 at Hostnordic A/S, Åhavevej 5, 8260 Viby J.. A couple of guys from Vertica will definitly be in attendence, myself included. If you're thinking about attending go and post about in the ActiveDeveloper forum or leave a comment at Vadstrup.dk.

UPDATE: There's an attendee list up at Vadstrup.dk.

posted on Wednesday, June 06, 2007 6:02:08 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, May 23, 2007

The image says it all. Take a look at the full post Powerful/Free Download: Refactor! for ASP.NET 2.2 on Mark Millers blog. Thanks to my colleague Brian for passing this along. We have some tinkering to do in Visual Studio tomorrow morning I would think :)

posted on Wednesday, May 23, 2007 7:04:39 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Sunday, May 06, 2007

It's not everyday that you get the chance to sit down with one of the .NET rock stars and pick their brain. Nonetheless that's exactly the chance we got this week when Patrick Tisseghem swung by the office for a beer and a chat. We've been wanting to hire Patrick and U2U for a training engagement for a while but our schedules just didn't fit. Luckily circumstances meant that Patrick was in Aarhus for another engagement and offered to swing by the office if we'd provide some beer for the session. Naturally we did :)

We first learned about Patrick and U2U at TechEd 2006 in Barcelona where he gave a talk on creating a CMS site with SharePoint Server 2007 (a publishing site in MOSS terminology). We were very impressed with the demo as he got a site up and running in 45 minutes with nothing but the SharePoint Designer, no Visual Studio needed. Very convincing. You can read my reaction to his session in my post entitled TechEd 2006: Web Content Management and Microsoft Office SharePoint 2007. The other thing I remember very clearly from that session is that I've never encountered a living person who said "Microsoft Office SharePoint Server 2007" so many times in such a short time span :)

Back to our session with Patrick. There was no formal plan for our chat and what a great thing that turned out to be. Basically we spent three hours talking about our ideas and how we envisioned them implemented in SharePoint. He in turn let us know how we could go about leveraging the platform. Great stuff and making it even better was the informal tone. Patrick is a very knowledgeable person when it comes to SharePoint and the .NET platform in general but what made his views even more convincing was the fact that he had a very ... lets say realistic image of what SharePoint is and what it isn't. I was actually surprised that he had such a balanced view of the product, he even went as far as calling some of the features "samples" which is right on the mark to my mind.

Of course I couldn't help but ask about the future for SharePoint to which Patrick had a very interesting answer: Basically we'll see even more functionality moved to SharePoint making it the "one" platform for the future. Now I got to admit that I do have a problem with the "the can be only one" way of thinking. I'm worried that making SharePoint the Swiss-army knife of web software will dilute the value of the product. When trying to be all encompassing you are very likely to miss the mark by a huge margin and not do any of the areas well.

Also SharePoint is a hugely expensive product at this point and rightly so: It addresses a wide audience. My fear is that SharePoint will become prohibitively expensive to a market such as the Danish where we're dealing with many small to medium sized businesses and not very many large companies. From my point of view markets are going to open up for ISVs who target these markets because Microsoft seems oblivious to these markets. Of course this can be remedied by licensing so it will be very interesting to see what Microsoft does next.

Finally I'm concerned that complexity will bog down developers with nitty gritty details, abstraction this, abstraction that. SharePoint is a complex product as it is, adding more stuff to the product will naturally need to be accommodated by more complex architectural solutions which we need to understand to be able to go in a customize according to the wishes of our customers. In this day and age where agile methodologies are all the rage we need to select products which support this way of thinking and SharePoint is rapidly moving away from this.

Enough about me ranting about SharePoint. I like the product make no mistake about it but I do think that solution providers need a broader perspective on the standard platforms available out there in order to be successful. This has always been the case but in a market such as the Danish this is even more true.

We covered a lot of ground and even got around to discussing Silverlight and AJAX. Silverlight has been announced to the public recently and of course we were eager to know more about it. Now I have to admit that I didn't particularly see Silverlight as something relevant to us since we're focused on doing tight backend solutions. Designers provide the layouts and UIs we need and we implement them. That was true until I learned that Silverlight actually includes a small version of the .NET Framework running on the client. Version 1.0 doesn't have this but the alpha of version 1.1 does and with it I see a point to actually investing time and effort in learning about the technology. Simply put we're now able to do web UI running on the client in C# and VB both an exciting and slightly confusing prospect because we have some overlap with AJAX functionality wise. Another thing for my todo list I guess :)

We have a guy coming on soon who has changed career path from designer to .NET; I think I need to turn him loose on Silverlight and see what he can do :)

posted on Sunday, May 06, 2007 11:49:47 AM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Tuesday, April 17, 2007

Well it's been out for a while but I was having trouble finding out what is new in this release from the main site. Jon Galloway has the lowdown on that one:

  • Multiple Database support! Now you can generate a full DAL for as many databases as you like.
  • Enterprise Library 3.0 Support. Just added this in and it works nicely.
  • All-new command-line tool. You can now use our command-line tool (called SubCommander) to do all kinds of fun things, like generate your code and version your database. You can even hook into it using Visual Studio's External Tools - this will allow you to generate your project's code with the click of a button, and it will use your project settings (look for a blog post on Rob's blog).
  • Improved querying. You can now use our Query tool to run OR's, IN's, and aggregates. You can even type what you want to see:
    IDataReader rdr = new SubSonic.Query("Products").WHERE("CategoryID = 5").ExecuteReader();
    We've also renamed many of our methods (well, we've added aliases) to make the query more readable. You can now use WHERE, AND, OR, IN, BETWEEN_AND, etc. to make your calls that much more readable.
  • New Controls. You can now use our Smart Dropdown, which loads itself:
    <subsonic:DropDown id=mySmarty runat=server tablename="categories" />
    You can also use our new ManyToMany Checkbox list helper to both list and save information for many to many relationships:
    <subsonic: ManyManyList id=myList runat=server MapTableName="Product_Category_Map" PrimaryTableName="Products" PrimaryKeyValue="1" ForeignTableName="Categories" />
  • A new AutoScaffold page that you can drop right into your project to admin all your tables. This thing reads your tables and creates scaffolds for you automagically (thanks Eric!).
  • A completely reworked code-generation system that uses an ASP-style templating system. You can now code up your templates like you would an ASP page (also just like CodeSmith). Test them in your web site to make sure they work, then replace (or add to) the bits that get generated at runtime. You can override our templates by specifying a template directory in the web.config:
    <SubSonicService defaultProvider="Northwind" fixPluralClassNames="false" templateDirectory="D:\PathToMyTemplates">
  • Regular Expression Naming Engine. If you don't like what our convention is, then you can use your own with some simple regex. Pass a simple string, or a dictionary replacement and all of your tables/views will be renamed as you specify.
  • Query Inspection. Want to know what's happening to your query, and how long it's taking? You can simply use the new Inspect() method which outputs the results and statistics to HTML for you to review.
  • Improved Trace/Debug. We've added tracing to (almost) every facet of SubSonic, so if you turn tracing on you can see what SubSonic's trying to do. We're always adding to this and if you see something we've missed, let us know :).
  • Improved Scaffolding. Your foreign key values are now pulled into the GridView and displayed instead of their keys. Eric figured this one out - go dude!
posted on Tuesday, April 17, 2007 12:13:10 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Monday, April 09, 2007

The final release of Enterprise Library 3.0 is upon us. I've have been looking forward to this release for some time and the timing couldn't be better as I'm currently architecting two new solutions which will benefit significantly of the new features offered by EntLib 3.0 such as the Validation Block also the Policy Injection Block looks very exciting. Can't wait to get my hands dirty with those two. Of course the ever popular logging and data access blocks are still included, using those is just a no brainer as far as I'm concerned.

Here's what program manager Tom Hollander has to say:

"If you've been keeping up with the Community Technology Preview releases, there shouldn't be anything too surprising in the final release, although the overall quality should be much higher. All of the major new features have already been described on this blog or in other places, but here is a quick summary of the most significant changes"

[Just Released! Enterprise Library 3.0 - April 2007]

Download Enterprise Library 3.0 - April 2007

posted on Monday, April 09, 2007 10:16:29 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, April 04, 2007

In an effort to make my unit tests easier to create I am looking into doing more interface based programming. I highly recommend MSDN Architecture Webcast: .NET Interface-Based Programming with Juval Lowy of IDesign for a good start.

posted on Wednesday, April 04, 2007 12:58:46 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, January 23, 2007

Yes it's finally here. I use finally lightly as the development cycle of the product has been anything but slow and now we've got the final version to play around with.

"ASP.NET AJAX 1.0 delivers a rich client-side AJAX library that provides cross platform, cross browser support for a core JavaScript type-system, JSON-based network serialization stack, JavaScript component/control model, as well as common client JavaScript helper classes.  ASP.NET AJAX also delivers a rich server-side library that integrates AJAX functionality within ASP.NET, and enables developers to easily AJAX-enable existing ASP.NET 2.0 sites with minimal effort."

[ASP.NET AJAX 1.0 Released]

posted on Tuesday, January 23, 2007 8:34:22 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, January 08, 2007

Do you wonder how the ADO.NET Entity Framework fits into the whole LINQ story? I did too. I actually didn't see the point in this framework with LINQ doing almost the same thing. Channel9 has a video which cleared the whole thing up for me and man am I excited about it. LINQ/ADO.NET Entities could prove to be the most significant feature of the Orcas release. I know it is for me. There are probably a couple of ORM vendors out there feeling the same way :)

ADO.NET Entity Framework: What. How. Why.

posted on Monday, January 08, 2007 1:07:44 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, December 25, 2006

It's here. Microsoft Enterprise Library 3.0 is here. As a CTP anyway. Personally I'm looking forward to getting my hands dirty with the Validation Block. With this release the team has moved on the Codeplex so you need to go there for your EntLib fix in the future.

Validation Application Block

  • Core validation API
  • Minimal Validator Library
  • Attaching validators to objects via attributes
  • Attaching validators to objects via configuration
  • Not included yet (but in the works): Configuration tool support, complete validator library, integration with ASP.NET, Windows Forms, WCF etc.

Just Released! Enterprise Library 3.0 - December 2006 CTP

posted on Monday, December 25, 2006 11:28:48 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, December 20, 2006

I completely missed this yesterday: Visual Studio 2005 SP1 has been released.

Scott Guthrie has more information about it.

This SP release is a pretty major service pack, and incorporates a lot of bug-fixes and feedback from customers.  Included built-in with the service pack is support for VS 2005 Web Application Projects (which we also made available as a separate download back in May).  It also contains a number of design-time performance optimizations and fixes across the product.
[Visual Studio 2005 Service Pack 1 (SP1) Released]

Download Visual Studio 2005 SP1

posted on Wednesday, December 20, 2006 2:25:19 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, December 14, 2006

It's actually been out for a couple of days now but I wanted to take the time to try it out in various scenarios before telling you about it. It's no secret that I've been very fond of ReSharper in the past. Of course I cooled down a bit when I tried using it on very large projects and it slowed all the way down to the point where it was just painful to develop with it installed. At that point I decided to give it a rest for a while and it wasn't until recently that I noticed that the EAP program for 2.5 was in progress.

Taking a quick look at the feature list I noticed that performance was one of the main problems being addresses in the release so naturally I was excited and got it installed.

Having used it on both large and small projects I can safely say that the performance improvements are definitely there. So much so that I'm back loving ReSharper.

A couple of pain points still exist for me:

  • Automatic intellisense for enum values when you assign to an enum type.
  • Migration of settings between installs is painful. Between versions even more painful as the command names you bind your hotkeys to actually changed between 2.0 and 2.5.
  • Standard hotkeys in VS you use all the time are actually remapped which leaves you with the option of mapping them back or trying to figure out standard hotkeys in ReSharper which does the same thing (hello there F12 vs. CTRL + B).

To relieve the last pain point I'm actually trying to stick with the default key layout as my two last points are closely related to me having to remap keys every time I install ReSharper. I do the same thing with VS because I don't want the hassle there either.

Also please be aware that JetBrains is raising the price for ReSharper to $249. You can buy ReSharper for the usual $199 until the end of the year. So get those credit cards rolling if you're considering getting a license.

Download ReSharper 2.5 (you'll be glad you did).

posted on Thursday, December 14, 2006 2:59:26 PM (Romance Standard Time, UTC+01:00)  #    Comments [2] Trackback
# Tuesday, December 12, 2006

If you hadn't figured it out by the name the Polymorphic podcast is a show about .NET or as its tagline states "The show about object oriented development, architecture, and development in .NET". That was enough to get me hooked and if you're not already listening to the podcast you should. It's not the second coming of .NET Rocks but it sure is close. The format is very similar to .NET Rocks and I enjoy listening to Craig Shoemaker interviewing people on various topics.

I first came across the Polymorphic podcast in the beginning of the year when I was remodeling our new house. Painting all those walls just isn't my idea of a good time but the podcast made light of the work. I think I went through 20 episodes just like that :)

Lately Craig has posted two very intriguing episodes which I urge you to listen to. The first one is with Object Thinking - Interview with Dr. David West. As you might have guessed the topic is OOP but what is interesting here is that the angle is much more theoretical than what you usually come across. Quite refreshing. I fully concur with the statement "Everything is an object"  it's something I try to live by every day.

Second up is Architecting for Extensibility - Interview with Miguel Castro (Parts 1 & 2). Quite refreshing listening to Miguel talking about something other than custom web controls :) I found the pattern Chain of Responsibility / Intercept Filter he mentions towards the end of part 2 (19:44 minutes in)especially interesting as it's a very neat way to go about creating a plugin architecture and it really got me thinking serious about doing something like that for future projects. I really like the idea of being able to retro-fit functionality later in process to allow for quick results for the customer.

posted on Tuesday, December 12, 2006 7:36:20 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Got to love CSS when you're able to take this:

And turn it into this:

Here's the CSS class I used to do it:

.validationSummary
{
width: 720px;
border-width: 1px;
border-style: solid;
border-color: #C3D9FE;
background-color: #EEF5FF;
padding-top: 8px;
padding-left:35px;
padding-bottom: 10px;
font: 11px Verdana;
color: #8598B9;
background-image: url(../Images/Infobox/Info.gif);
background-position: 10px 6px;
background-repeat: no-repeat;
margin: 3px;
overflow:hidden;
}

posted on Tuesday, December 12, 2006 7:20:41 PM (Romance Standard Time, UTC+01:00)  #    Comments [2] Trackback
# Thursday, December 07, 2006

Tom Hollander writes about the new validation application block which will be included in Enterprise Library 3. I've been hoping for a feature like this in EL ever since I participated in their survey about which features to include in the next version. Validation is something I've often seen solutions skip and it's something that can really make a difference in the end product for the user.

Here's a snip from his post:

"The Validation Application Block will include a comprehensive library of common validation rules that apply to primitive data types. For example, we'll include rules like string length, numeric range, date range, regular expressions and so on."

Validation Application Block: Revealed!

posted on Thursday, December 07, 2006 2:26:43 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, December 05, 2006

Well kinda anyway. Check out Scott Guthrie's post about WPF/E. The technology sounds very interesting.

"WPF/E" delivers a small client runtime that enables AJAX developers and designers to deliver richer, cross-platform, interactive web experiences.  It will allow applications to go beyond what can be done with pure HTML today, and will enable sites to significantly improve the client user experience by blending HTML UI, Dynamic Vector Graphics, Animation and Media into a seamless cross-platform browser experience."

Announcing the release of the first "WPF/E" CTP

posted on Tuesday, December 05, 2006 3:23:49 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, November 27, 2006

Next geek dinner is up. .Henrik and Thomas Jespersen has the skinny. Great opportunity to get out and meet your fellow .NET'ers and maybe even learn a little something :)

It's not saying much but I'll definitely be there. Last time was a blast for sure. Sign up at geekdinner.dk. Microsoft is doing a Meet Microsoft about Office and SharePoint which you might want to attend also.

posted on Monday, November 27, 2006 10:02:50 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, November 24, 2006

I posted a picture of Ron Jacobs doing an ARCast at TechEd Barcelona and today I stumbled across a video of that very same thing. In it Ron discusses the Loosy Goosy SOA anti pattern with Christian Weyer, a pattern which is near and dear to my heart as this anti pattern above all seems to rear its ugly head the most.

If you want to get a feel for the event check it out. Check out the original post as well while you're at it.

posted on Friday, November 24, 2006 3:00:42 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, November 10, 2006

I've my fair share of posts from TechEd with I've found the technology interesting and wanted to learn more about it and so I did :) Workflow is something I see a need for in 99% of projects I've done up until this point and in coming projects I have on the horizon. I won't bore you with the details about WF here you can however go to the site for WF if you want to get some background information on the technology.

So this was a whiteboard discussion and lots of great questions were asked. The first one:

Why?

Why did Microsoft create WF? They did it because they identified a need for such a thing internally in Microsoft. Lots of their products have some sort of work flow built like Exchange (Assign Task to User), SQL Server, and of course  BizTalk. A lightweight framework for doing workflow was needed in order to allow for it to be used in smaller scale applications such as web- or win applications.

WF is already in use in some Microsoft products today examples are SharePoint server, nothing too surprising there, however it may surprise you to learn that Speech Server utilizes WF also. There are other examples but those are the ones he could remember off of the top of his head. Also BizTalk will use WF for orchestrations in the next version.

When should we use BizTalk instead of WF?

It's basically a build vs. buy decision. You can do everything with WF you can do in BizTalk it requires some custom programming though. I liken the situation with that of SharePoint Server and SharePoint Services. With services you get a lot of standard functionality to build on and with server you get lot of extra bits on top of that.

BAM can monitor WF in BizTalk R2

How do you expose WF to the end user?

There's a MMC snap-in called the Workflow Manager which can display and alter workflows. WF provides a design surface for workflows which can be hosted in any application. It can even be used in a web scenario as it can save itself as an image and be displayed to the user in a browser that way. You cannot edit in that case but there are some third party clients which uses AJAX to provide a similar experience to the design surface.

How do we create workflows?

You use the design surface or create it using code. A workflow is stored as XAML the workflow engine loads this file and processes it. As we are only dealing with XAML workflows can be stored anywhere.

Versioning?

When you start a new process the workflow definition is stored alongside the process. This means that a running process will be unaffected when you update a workflow definition. You override this behavior and have the definition updated for running processes as well.

How do we create a page flow with WF?

Page flow is a UI driven by WF. You create a page for each state and utilize a state workflow. Rules will determine which step is the next in the flow. A demo was shown of an internal prototype for creating navigation workflows. We might see it in the next version.

Exception Management?

Exception management as in errors in a business process not as in System.Exception. It's a good way to introduce workflow into legacy applications. When something happens in the existing process you can have it trigger the workflow to handle the exception. From here on in the workflow will do the heavylifting until the issue is resolved. At this time the workflow will pass a message back into the legacy process to tell it that the issue is resolved.

Rules?

WF supports rules with its rules engine. Rules are a way of externalizing conditions on might a workflow acts. Complicated rules are more easily handled this way. They are stored in a separate file from the workflow definition. Visual Studio includes a rules editor when WF is installed. The rules engine can be employed outside the WF framework and be run against objects if you only need the rules engine. it supports chaining meaning that if a rules passed in step 1 but step 3 causes the rule to not validate any longer the rules engine will detect this and fail the process. The behavior can be turned off if you so desire. The rules should be employed if they change a lot. There is some deadlock detection present but this is an area which will be expanded in the future and a rules API exist if you need to do advanced deadlock detection today.

Diagnostics?

A tracking service is provided which writes results to the SQL Server datastore on top of this you can build reports which can be used to display workflows which might be having issues.

How to create business processes and longrunning processes?

I actually asked this question because it's something which has been on my mind as this is the area where I see an immediate need for WF.

Some kind of host is needed, typically either IIS or a Windows service. Choosing one over the other is a question of how much processing the workflow will do. IIS may be busy serving up pages and it would be unfortunate to burden it further with heavy workflows. You would use IIS if the workflow is operating in a request/response environment.

Event driven workflows are the way to go with longrunning processes. Basically a nobrainer there.

Restarts are handled gracefully if the reboot is done properly. Turning off the machine without allows it to shutdown will of course not work the workflow will restart from the last save point in this case. A proper shutdown will cause the workflow to persist itself using the persistence service (which you can create yourself). Powerouts and other situations which can't be handled by WF can be dealt with by using System.Transaction.

Multiple consumers can work on a single store of processes to allow for scaleout scenarios. Processes will be logically locked to prevent them being pulled into multiple consumers.

posted on Friday, November 10, 2006 11:18:40 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Jeff Prosise, Wintellect and Andres Sanabria, Lead Program Manager for AJAX did a great presentation on AJAX patterns and what we need to look out for in the brave new world of ASP.NET AJAX. As I've mentioned earlier Nikhil Kothari called in sick which was unfortunate.

It's great to see that Microsoft not only throws cool new stuff out there and sees what happens. They also take responsibility for the new technology and provides guidance on how to use and how not to use it. This presentation is a great example of that.

UpdatePanel is a great way to get started with AJAX and it gets the job done in 95% of all cases. That's my guess anyway. What we need to be aware of the fact that we are only doing partial rendering with UpdatePanel, not partial postbacks as you could be lead to believe when seeing the control in action. What actually happens is that the entire ViewState is sent back to the server for processing in order to allow for an experience very similar to that of a normal postback, i.e. the full control tree will be instantiated and the entire page life cycle is processed. The only difference shows up when we get to the rendering of the page. Here ASP:NET is smart (a header is sent back stating the fact) about the fact that it's dealing with an asynchronous postback and only renders the parts of the page which are needed. What this translates to is lots and lots of traffic going across the wire and we need to very aware of this fact.

Another thing to be aware of when working with UpdatePanel is that it has a property called UpdateMode. This property determines what triggers an update of the control. The default setting is to trigger an update whenever an asynchronous callback happens. Suppose you have four UpdatePanels on a single page. The default would cause each of these to get updated whenever an update is triggered within one of them. To fix this you would set the UpdateMode to Conditional allowing for more granular control of the panel. You can then either specify a number of triggers in the control definition on the page or you can call the Update() method of the panel you want to update on the serverside.

Now what can we do about the ViewState being sent back and forth? The answer is webservices. When invoking webservices in ASP:NET AJAX data is sent across the wire serialized using JavaScript Object Notion (JSON). So you either expose an ASMX endpoint on the server or create a pagemethod and then call that from the client. The framework will provide a proxy you can use to interact with the service but you'll have to act on the data coming back from the server. Not too much of work and it's a very valuable technique if you need to minimize traffic. In case you were wondering AJAX enables standard ASMX endpoints to serialize their output using JSON notion because of an extension installed with ASP.NET AJAX Extensions. You can try this out if you have the extensions installed by adding adding /js to the end of the endpoint address, e.g. endpoint.asmx/js.

A thing that has been on my mind regarding all this AJAX goodness is how useful it really is if we cannot maintain browser history to make the back and forward button work. Also not having URLs which the user can copy and paste from the address bar is a pretty critical issue. Have no fear. Nikhil Kothari to the rescue with his HistoryControl which tracks events in our AJAX apps. It'll even keep the browser URL updated with state information so that the user can use the URL in a portable manner like she is used to. You can read more in Nikhil's post Back Button Support for Atlas UpdatePanels. This addresses my biggest concern with AJAX as we just can't break the conventions people have gotten used to over the past years. Epically not in a customer facing web frontend such as a retail site. An internal business site is a bit more forgiving due to the fact that we can perform user education but it would still be better not to break anything.

So they also introduced a new concept called structured scripting which basically is a fancy term for wrapping the AJAX code in a custom control or behavior where a control is a full blown client/server control while the behavior is some wrapped JavaScript you can attach to another element, basically an ExtensionControl as I understand it.

One interesting thing is that the AJAX library introduces a client-side page life cycle kind of like what we know from standard ASP.NET. It's complete with events we can hook into and do all sorts of interesting stuff.

posted on Friday, November 10, 2006 10:28:19 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

OK so we are at our final day of TechEd and I thought it pertinent to go listen to a session on security with focus on web app security so much in focus these days. Keith Brown of Pluralsight did the presentation which amounted to a good talk about well-known attacks which we need to be aware about like SQL Injection, cross site scripting, and finally SQL Truncation attacks which is a new thing. Really not much new there but he did provide some techniques for dealing with it.

Of course we all know that the way to go with SQL Injection is to always use parameterized queries and that's the end of it. Basically what we need to be aware of is that dealing with string concatenation will cause problems at some point so try to avoid it. We don't have many instances in our applications where we absolutely need to use dynamic queries and I think the same thing goes for many others.

Cross site scripting is actually an area which I haven't given much thought, probably because of the inherent nature of the systems I do. Cross site scripting is what happens when we allow a user to input unsafe values into an application such as HTML and script code. If we persist this data in say a forum application, we'll end up in a situation where the unsafe input may be presented to other users of your site and that will cause problems. The answer to this of course to filter unsafe data. Microsoft patterns and practices has a tool which will help you do so it's called Microsoft Anti-Cross Site Scripting Library; quite the mouthful too :) It's a basic class with two methods for filtering and replacing in a string before you store it or send it to the user.

Also Microsoft has a tool for doing threat modeling. I thank we all do threat modeling at some level but seldom we get around to putting the information into structured form. Microsoft Threat Analysis & Modeling v2.0 allows us to store the information in a structured manner and it will even help us by analyzing and comparing the information to a threat database which contains known exploits in order to do a visualization of the application and it's weak spots.

Main points of the talk:

  • Consider user input dangerous
  • Place input values into strongly typed variables, i.e. do int age instead of Request.Form[ "Age" ];
  • String concatenation in concert with any form of SQL is dangerous
  • Consider user input dangerous, it really gets down to user wanting to exploit our applications
posted on Friday, November 10, 2006 9:51:40 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, November 09, 2006

I attended another whiteboard discussion on the subject but elected not to post anything about it because it really was a waste of time. I chose to try my luck one more time as the moderator of the session would be Nikhil Kothari. Unfortunately it turned out that he has fallen sick and so we had a couple of other guys from the team take his place. Now this wasn't a bad thing by any means. Their names elude me right now but we had a Product Manager for AJAX and the developer who did UpdatePanel which if you've done anything with ASP.NET AJAX will know about. Both were very knowledgeable on the subject and we had a great discussion. We were kind of all of the map with a lot of focus on both ASP.NET 2.0 in general and of course ASP.NET AJAX.

They set the record straight about the composition of the AJAX package something I've already done a post about. Other than the general discussion I took away three things:

ControlState is a new construct of ASP.NET 2.0 which I'd forgotten everything about. If you are a control developer you need to keep this one in mind. We all know that ViewState can be rather bloated so we turn if off in places we don't need. Now I don't know about you but I've done my fair share of controls which will explode if someone turns off ViewState on them, simply because that's the only option we had in the past for saving temporary data. With ControlState however the story is different. You simply cannot turn off ControlState. This means two thing for us: 1) We can happily go on creating our state bound controls, 2) We should take care to only store what is absolutely critical for the control to work in ControlState. Think about the DataGrid, what if someone decided to place its state data exclusively in ControlState. Not a pretty picture I'm sure.

== is not ==

What do I mean with that? Well it turns out that Javascript has a very funky implementation of our dear == and != operators. What it does is that it tries to do some magic for some reason to create maybe a better comparison? Whatever the case the end result is that you get some very weird results when using == and != in Javascript. The rule of thumb is to use === (yes triple equals) and !== because to behaving more like what we are used to in C#. That's certainly something to keep in mind.

Finally Nikhil has some very cool tools. Where I'd like to point your attention in the direction of his tools page and Script# in particular. Script# is a tool written in frustration with Javascript. Nikhil wanted a way to write Javascript without writing Javascript, the solution? Create a tool you write C# code in and then let it convert it to Javascript. For a person like me who's done very little clientside development and certainly never any systems with an actual Javascript strategy it looks like a great tool. I certainly will be doing some experimentation in the very near future.

Someone asked a question about who you deal with multiple concurrent HTTP connections from an AJAX frontend. Browsers today pretty much limit you to two connections per domain as a default. So what what do you do if you need more than that? A trick suggested is to create multiple subdomains and have your website respond to requests on additional host headers to trick the browser into believing that the request goes to different servers. A technique used by local.live.com for example.

Regarding performance there's one caveat that you should know about when dealing with AJAX and even ASP.NET: Never deploy a site with debug set to true. It's always been true for ASP.NET now even more so. The reason is that AJAX comes with two sets of scripts: One for debug mode and a more efficient one for release mode. They are equivalent in functionality but the debug script include lots more code and as you can imagine it's in hum readable form. What AJAX will do to optimize performance in release mode is to replace variable names with shorthand names in order to speed up parsing of our scripts. It will also remove some type checking in the library which under debug mode checks whether the correct types are passed to the AJAX Library functions. Finally whitespaces will be removed to keep the script lightweight and again to speed of parsing.

posted on Thursday, November 09, 2006 8:02:25 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Next up Fritz Onion with a presentation on the different tooling we can use for debugging AJAX apps while we wait for the Orcas release of Visual Studio. What the session amounted to was an overview of the different extensions for IE and Firefox available in this space. What was great about the session is the fact that he gave a very good presentation. He speaks in an engaging manner and gets the points across easily. Not much to write home about contentwise we're were basically given a demo of the stuff I list further down. It did give a great starting point as to which tools to try out thus getting me started relatively easily with creating our AJAX apps. Also a good thing to have a couple of more tools on your radar should you end up in a situation where you'll need it.

The tools available today include:

Visual Studio Javascript Debugger

Microsoft Script Debugging

Firefox Javascript Debugging

Firefox DOM Inspector

Firebug

  • You will need this one

JavaScript Shell

  • A shell for exploring Javascript code as well as executing little snippets

Fiddler

  • HTTP proxy which intercepts the traffic on port 80 and displays it. You can even modify the request to do some testing or hack proofing if you so fancy.

ASP.NET Development Helper

  • Main function is to decode ViewState and show its contents. You also have a DOM explorer in there.

TcpTrace

  • Does the same thing as Fiddler but it doesn't install itself as a HTTP proxy which is both a good thing and a bad thing. A good thing if you don't want some debugging tool to take over your system, a bad thing because you will have to do a couple more steps to get it working. I'd probably stick with Fiddler.

IE Developer Toolbar

  • Probably doesn't need further introduction

Web Developer Toolbar

  • Same for this guy. Though one thing to note is the fact that it has so much stuff that it gets hard to find what you're looking for in the menus.

Tamper Data

  • Surprisingly enough it allows you to tamper with the request, like Fiddler and TcpTrace does.
posted on Thursday, November 09, 2006 7:31:38 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

First session of the day was Anders Hejlsberg on LINQ to SQL. As the conference has proceeded my interest in LINQ has increased and this session was the culmination of that. LINQ to SQL is basically an OR mapper and a very impressive one at that. As I wrote in my post regarding the LINQ project in general you get the ability to do integrated queries in the .NET languages.

What LINQ to SQL provides you with is the following:

DataContext

You'll derive from this class in order to create a strongly typed representation of your own database. This effectively becomes the manager for your database for stuff object references and primary keys. More on this later.

Entity classes

For each table you get a class representing that table. You can choose a number of ways to attack the mapping of tables to objects. You can either use the visual designer in Visual Studio to drag and drop tables from your SQL Server datasource onto the design surface this creates the actual code for the class, you can go class-first where you create your classes first and then map to your datastore either by adding attributes to the the members of the class or you can externalize the mapping in a XML file, finally you can opt for the full blown mapping provided by a tool called SQLMetal which connects to your datastore and creates classes for every single table in there.

Relationships

Of course relationships are observed and properties are created to map those as well. For example you have the classic customer and orders mapping where a customer has many orders. The orders would be translated into a collection available on the customer class. Very nice indeed.

Querying

This wouldn't be LINQ if you weren't able to query your data. LINQ provides are very rich model for querying data be it SQL, XML, objects, DataSets, and more. You can do all kinds of crazy stuff not available in SQL, e.g. you can use the output of a stored procedure to further query that data. It's all handled by LINQ which does some additional manipulation in memory. Ad hoc joins are available like you would expect. Finally LINQ uses a notion of deferred execution for executing the queries. What this basically means is that the query won't get executed until you actually need the output. So defining the query doesn't execute it, it won't get execute until you actually use the results it produces.

Of course the language constructs you use to create your queries are the same regardless of the data your are querying so you only need to learn a single set of operations in order to work with all the supported data stores.

Updating

For updating and inserting data LINQ provides a mechanism for keeping track of the changes. You can go nuts and do a whole bunch of updates and nothing gets updated until you call the SubmitChanges() method. Pretty nice to be able to batches in this manner.

Stored Procedures

Procs are supported by creating methods representing each stored procedure on the DataContext class. Each method returns a strongly typed resultset which contains the output of the proc. Say for example that you do a proc which returns CustomerName and CustomerAddress, your result would then have properties with the same names. No more looking at a method which returns a DataSet, then having to go to the database, and look at the output of the stored procedure in order to figure out which columns you have to work with.

I was very curious as to how LINQ to SQL goes about getting data across and I've very pleased to report that all my concerns were put to shame. For example I was wondering whether data projection would yield lots and lots of different anonymous types flying all over the place thus lessening the value of our business objects. This turns out not to be a problem as LINQ to SQL is strongly typed which ensures that you only get your business objects returned. Also we use lots and lots of lazy loading to allow our web apps to scale well. This fortunately is also supported in LINQ, it's the default behavior in fact, but you can override it if you want. You can be very explicit about what you want LINQ to bring back to you.

If you haven't picked up on it yet I can tell you that I' very excited about LINQ at this point. Now all I need is for someone to create Query Analyser for LINQ for me and I'm good to good. What's even more interesting about such a tool is the fact that you would be able to target not just SQL but all the supported data store, although the queries wouldn't be interchangeable.

posted on Thursday, November 09, 2006 7:24:23 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Ron Jacobs did the last session of the day and while I did get around to finding my pad to take notes I never did get around to actually doing any notes. Ron spent the idle time before the session asking the audience what they think about ArCast, the podcast he hosts. While I appreciate the technique of engaging the audience I really didn't care much for it. It's basically my equivalent of waking up naked from the dream where you walk down a crowded street only to find that you are completely naked. Yes I know, it's all very friendly or should I say fiendly? :) Maybe I'll be more susceptible next time around.

Ron is a very engaging speaker and he did a very good job to describe the various anti-patterns of SOA. He also mentioned a couple of real patterns for us to use in our architectures. It's nice to see a very authoritative figure on the subject give his opinion. Particularly because it gives me the ammunition in future meetings to pick people off when they suggest some sort of half-assed integration mechanism.

Anti-patterns include:

  • CRUDy interface: Database CRUD methods instead of business processes.
  • Enumeration:  Stateful servicecalls that muddies the datasource responsibilities.
  • Chatty interface: You call multiple interfaces to accomplish a single operation. I'd like to add that this is a bad idea under normal circumstances as well. You basically delegate the responsibility to do the right thing to the user of your interface even though you might as well do the work yourself with a single interface. Always try to keep your interfaces as simple as possible.
  • Loosy Goosy AKA the Über Serice AKA XmlSerializer Execute(XmlSerializer request) in the quest to create a very flexible interface you end up creating a very thightly coupled interface instead. Because the consumer doesn't know what to send to interface he's afraid to change his implementation on the client. This is my personal favorite by the way as I've seen it once too many on solutions I've done consulting on.

Patterns include

  • Well basically you should think about how transaction were done in the old days before there was such a thing like computers. People transferred documents (messages) between departments (explicit boundaries), and the processing was done in an asynchronous manner (people didn't stand around waiting for the person responsible to process the document). He calls this the Document Processor pattern.

What he failed to mention was how to keep up developer productivity while doing all this kind of stuff. What I've found is that we don't really have a problem doing stuff "the-right-way(tm)", however doing so is very costly. We effectively spend a lot of time doing what I would categorize as infrastructure code. How do we deal with this added complexity? Now one could argue that we should use the WS-* functionality provided by WSE or WCF. My argument against this is that we don't yet have an RTM version of WCF and WS-* is really just a layover for the release of WCF and really this is only a partial solution to address the added costs of implementing a service oriented architecture.

posted on Thursday, November 09, 2006 1:35:32 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

My reason for going to this session is that I am looking at a rather larger big project which will need both Commerce Server 2007 and some sort of Content Management System. I've been looking at SiteCore, Synkron, and of course SharePoint 2007. Now we've been trying to set up a meeting with Microsoft for ... well it feels like forever since I need the info like 1½ months ago. Fate would have us wait until TechEd to get at the info but bout was the wait worth the wait.

I basically got all the information I needed and the answers I wanted. Patrick Tisseghem really knows his stuff and it's obvious why he was give a speakers slot at TechEd. I wouldn't want to go up against him in a market that's for sure :)

The session revolved around showing us the "out-of-the-box" experience of the CMS features of SharePoint 2007. I've done some work on Microsoft Content Management 2002 and as far as the developer experience goes it pretty much delivers. However it leaves a bit to be desired on the business user side. You basically need to do a whole lot of Visual Studio development in order to get the business users going.

SharePoint 2007 delivers a very different story. Visual Studio is only required for adding new functionality to SharePoint. You will not need it to do the basic CMS tasks like you did in the past. I was very impressed with what you get out of the box. And I'm proud to say that we as company did "the right thing(tm)" when we went along with SP07 before we had all the facts.

Patrick demoed how we'd go about doing various common tasks in SP CMS. While everything was available to customize I do have second thoughts on the usability of the product. You have all kinds of switches to pull and my concern is that it will be too much for the business users. You will need a larger number of clicks to just enable CMS functionality of SharePoint. When you have enabled that, you will need to do a number of additional tasks in order to display custom information on your site.

With that said I think that we as developers will be faced with the task to simplify the job for business users. SharePoint adds everything you'll need to create a CMS site (yes the kitchen sink is included) thus we'll need to do everything in our power to present the available feature in a manner that will stimulate the users rather than scare them and ultimately alienate them.

posted on Thursday, November 09, 2006 1:04:22 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

First session this morning was C# 3.0 with Anders Hejlsberg. Basically the talk revolved around the features they've added to the language in order to enable LINQ which I talked about yesterday.

Type inference

  • A new keyword called var
  • Type is inferred from the right side of the expression: var customer = new Customer(); var = 10;

Anonymous Types

  • Creates a new type based on the data projected to it
  • Unspeakable types, only works with the var keyword

Extension methods

  • A way of extension existing objects with static methods
  • You could for example add a new methods to object and have it available on every single object in your application

Lambda expressions

  • Nice way of avoid having to create delegates and passing those to a method

Variable initializers

  • Customer c = new Customer() { Name = "Søren", Age = 28 };

Automatic Properties

  • Not yet included in CTP
  • string Name { get; set; }
  • Need to have both getter and setter.
  • Readonly possible by using { get; private set; }

Expression Tree

  • Data represenation of a query instead of IL
  • Better at showing intent than IL

LINQ

Also we got a few tidbits about where the language will go after the Orcas release. Of course he couldn't commit to anything but he did mention a couple of areas they're looking at: Dynamic languages and multi-threaded programming. They are keenly aware of the fact that people have regained interest in dynamic languages and so they are thinking about how to go about incorporating dynamic-like features into the language. Anders mentioned that he would try to adhere to a static typed environment where you don't need to specify type but the types are still there for the compiler to use while checking code at compile time and to do various refactorings more effective. It's good to hear that Anders is sticking up for the strongly typed environment.

My two cents on the matter are that while dynamic languages are great and very RADy, the argument that they are more viable today due to the fact that more unit testing occurs I just don't buy. Yes unit testing has become more prevalent but the fact of the matter is that you simply cannot do 100% code coverage when you need to get a product out the door. You'd basically need 100% code coverage in order assure the same levels of quality if you don't have the compiler to catch stupid code errors like type mismatches and that stuff. We as developers are lazy, we don't always get around to doing all the necessary unit tests, it sad but it's fact and so stupid errors will start to occur in our code.

I couldn't get an answer to my Orcas timeframe question yesterday but today Anders did mention that we are looking at maybe a year, maybe more, maybe a bit less to use his own words. Nice to have some idea of when we can expect all the new stuff in final form. Of course much of what is being demoed here is available in CTP form.

posted on Thursday, November 09, 2006 12:37:05 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

I was looking forward to this session due to some confusion I've experienced due to the fact that Microsoft has chosen to create multiple packages for the ASP.NET AJAX solution. The reason for this, as I learned, was to enable a more agile and transparent development process on the team involved with creating the actual AJAX controls. So my understanding of the situation is this: We have one team which creates the core ASP.NET AJAX Core and a second team, the agile one, creating controls based on the work the core team performs. This is the ASP.NET AJAX Toolkit. They release the toolkit as shared source on CodePlex and the community participates in the development, three Microsoft developers are on the team along with ten community guys, so definitely an interesting effort for sure.

The talk was mostly about explaining the ASP.NET AJAX Toolkit and to show how to go about creating new AJAX controls and behaviors (client-side behavior). Shawn Burke did a good job of remedying my confusion on the various downloads available under the ASP.NET AJAX name . The toolkit basically sits on top of the ASP.NET AJAX Server Extensions and a set of its own baseclasses which include both Javascript- and .NET classes. Of course all of this runs on ASP.NET.

Crossbrowser support is provided for Internet Explorer 6 and 7, Firefox, Safari, and Safari with partial support for Opera.

They have a very cool notion of Extender controls which, as you may have guessed, extends existing controls. For example the AutoCompletion extender. Think Google Suggest and you have the gist of it. More importantly you can employ the control without writing a single line of Javascript. This is the case with many of the controls you simply add some XML to the definition of the control and you are good to go. This will allow for more rapid deployment of the AJAX technology. I already have a couple of places where I could improve usability dramatically by only employing the serverside controls.

posted on Thursday, November 09, 2006 12:35:51 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, November 08, 2006

... aka Free Beer and Tapas night :) OK, so with the day's session overwith we proceed to the exhibition hall where Microsoft has kindly provided us with beer and tapas along with lots and lots of great technical content provided by various exhibitors. I got a nice demo of CodeRush and had them answer some critical questions about the product. Also I got a chance to see the Jetbrains guys showing off Resharper and DotTrace. Two of my favorite products.

Finally Carl and Richard was hosting Speaker Idol which is a contest amongst the attendees in which you can will a speaker slot for next year's TechEd. Afterwards they hosted the 64-bit Question Game Show where some great prizes were given away. Oh and did I mention the free beer? :)

I also got to see another Microsoft podcaster in the flesh: Ron Jacobs was there doing a live ArCast from the floor.

    

posted on Wednesday, November 08, 2006 12:22:49 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

There's not much I can add to the slides presented by Bradley Millington other than the fact that I was unable to get him to commit to a time frame for Orcas, I did try though :) Also there are some very cool stuff coming for Visual Studio to aid us in developing AJAX enabled web applications such as intellisense for JScript along with type inference which lets Visual Studio glean the type of a variable or the return value of a method by analyzing the code. Also new "hacks" are added to allow for XML comments in JScript and referencing .js files with other .js files. I call them hacks due to the fact that they really are comments formed in a special way which Visual Studio looks for; in essence they only work in VS. It's still nice to have though :)

Interestingly the CSS designer from Expression Web Designer will be available in Visual Studio which basically renders the entire Express Web Designer SKU moot in my opinion. In any case I'm glad that we'll have the designer in VS as I was actually thinking that Web Designer would be a product I'd need to install to get at it. The design surface is codenamed Sapphire by the way, you can always count on Microsoft to come up with some really cool codenames only to have them screwed up by marketing later on :I)

Finally we have Blinq which to me is the single biggest innovation in VS Orcas. If you are unfamiliar with Blinq it's basically a tool for generating a data entry web frontend based on the schema of your database. In the future Blinq will be able to generate a partial frontend based on your selection but for now it generates for the entire database schema. Also it will be able to target object to leverage our existing business objects. As you might have guess from the name Blinq utilizes LINQ to get at the data. Blinq allows for very  rapid prototyping of a web site kind of like what Ruby on Rails does. It's very nice to see Microsoft taking cues from other communities than the .NET one. Sadly this might mean the end for Subsonic before it even gets off the ground for real. Pity.

All in all a solid presentation. As it was the last presentation of the day a measure of quality would be my yawn rate which was way down in spite of the time of day :D

posted on Wednesday, November 08, 2006 12:07:06 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, November 07, 2006

Eric Rudder gave a pretty standard peptalk about how we should start using Windows Vista and Office 2007 the moment they are released. Actually Office should have gone RTM at this time. The keynote did have it's effect though, I was very exited to get to the actual sessions afterwards. Mostly due to the fact that all the attendees were gathered for the keynote and I really got a feeling of just how large an event TechEd Europe really is.

I leave you with some pictures of the keynote to enjoy.

        

posted on Tuesday, November 07, 2006 11:30:10 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

This session seemed like a good idea at the time when I was looking over the slots but in actuality it turned out to be quite the disappointment. It would seem that the AJAX part was included only to lure people in. Brad Adams did the session which was on cooperation between designers and developers. A topic which is relevant to most of us doing web applications. Unfortunately the session turned out to mostly be a demo of Express Web Designer where Brad Adams did a draggy droppy demo of the product. People who know me know how I abhor drag and drop :)

Express Web Designer is what I would call a light version of Visual Web Developer Express targeted at the design crowd out there and my humble opinion is that it fails miserably as such. What it's got going for it is a very good design experience for CSS but that's it. The premise for the product is to cut out the step in the design process where designers create image mockups of a web site and hands it over to the developers who then create the actual CSS and HTML layouts. The problem is that you loose fidelity in the process and while Microsoft is right on that I don't believe that they are going about solving the problem in the right fashion. They want the designers to deliver CSS and HTML layouts complete with ASP.NET controls embedded but I just don't see that happen. As far as I can tell graphical designers need to target as wide an audience as possible and they just don't do that but learning to use a tool which creates a product which basically only caters to ASP.NET developers. That's one problem the second is that the designers didn't become designers to muck around with ASP.NET controls and code. In my eyes they want to be able to set up color palettes, images, and other graphical elements. They simply don't care for the the nitty gritty of a framework like ASP.NET ... and why should they?

Now back to the demo. I mentioned that we were given a demo of the Expression Web Designer. To that I just want to add that Brad Adams should know his audience; the conference is called TechEd Developers for Christ sake, not TechEd Designers. People don't want to see him futzing around with margins, padding, divs, and so forth. We're developers, give us some code! As a result people started to ooze away around the middle of the presentation, leaving a jampacked room to only two thirds.

He did actually get around to doing some code, showing what the developer does with the product the designer delivers. A very cool thing he showed was how to AJAX enable an ASP.NET site in a very simple manner by using the UpdatePanel control which is part of the ASP.NET AJAX framework. While that was very cool it just took up too little of the session. Also we got got see a little bit of the ASP.NET AJAX Toolkit which contains some very cool controls for extending existing controls and all new controls too.

So to Brad Adams I give two thumbs down for the session, and a friendly reminder: Know thy audience.

posted on Tuesday, November 07, 2006 10:56:35 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

I just had to see Anders Hejlsberg do a presentation; the fact that it was on LINQ wasn't too shabby either. I was excited about the technology in the first place but having actually seen Anders do LINQ queries against various data sources really has me firing on all synapses :)

LINQ or Language INtegrated Query is basically a strongly typed way of querying data directly from a .NET language like C# or VB. LINQ consists of three providers: LINQ to objects, LINQ to SQL, and finally LINQ to XML. If you have had to write a program which needs to extract data from a XML file you know how much of a pain it is to do thus paving the way for a need for LINQ to XML. LINQ to SQL simplifies access to relational data and also provides mechanisms to do OR mapping. One question on my mind with regard to this feature is support for stored procedures and LINQ to SQL does indeed support them which to me is very good news indeed. LINQ to objects is the general purpose tool of the bunch which allows you to do queries against in-memory objects on any collection which implements IEnumerable which basically means every single collection in the .NET Framework. Anders did a couple of demos on this, first querying diagnostic data on his machine listing every running process, later querying reflection info for the String class and doing a couple of group by's. Pretty neat to see how many overloads of the CompareTo() method that exists. Think of the possibilities.

Now what is even more exciting is that the technology is domain agnostic basically enabling you to do a single query across multiple disparate data sources, e.g. you need to cross-reference some data from Active Directory with employee data from a database. Today it takes a pretty significant amount of code to do so, tomorrow with LINQ you will actually be able to do the correlation with a single query producing a strongly typed resultset which you can then perform further queries against if you so desire.

People might ask the question, "Why do we need to reinvent SQL?". To that the answer is that LINQ is so much more than SQL as I've described above. You cannot do querying across disparate data sources with SQL, you cannot query object, you cannot do OR mapping. It's pretty obvious that LINQ is here to stay and that we need to invest in the technology simply because it makes development more intuitive and more effective. Combine LINQ with Blinq and we're in serious business but that's a story for another post :)

posted on Tuesday, November 07, 2006 10:33:07 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, November 06, 2006

So ... first day at my first TechEd. It's been quite the ride already. As you've probably already seen I've gushed about seeing Mr. Franklin and Mr. Hanselman of DotNetRocks fame and of Hanselminutes fame.

More importantly I actually decided on a session, albeit 30 seconds before it started :) I decided to watch Roy Osherove's Agile Development with or without Team System as methodology is near and dear to my heart these days.

As I said this is my first TechEd and as such I had no idea what to expect. I've been to my fair share of MSDN Events and while they were decent Roy blows them all out of the water. He knows his stuff and it shows. He gave lots of pointers of generic stuff surrounding agile development and more importantly backed it up with actual personal experience. Instant authority. Mixing in some actual tools to get people started is great; especially for a person like myself who sees a tool for every problem :D

I could tell that he's very passionate about the subject. Sadly his real enthusiasm only shone though a couple of times. Don't get me wrong, the session was great but I can't help but feel that he was holding back a little for some reason. Maybe it's just his style.

Anyway great presentation, I'm certainly hungry for more. The hours went by without me noticing it. A good sign :) Tomorrow will for my part bring sessions on Commerce Server 2007, AJAX, a DotNetRocks panels discussion, and finally C# Language Innovations(with Anders Hejlsberg no less). I may not be able to sleep tonight :)

Finally here are some pictures of Sune (yes, Microsoft actually stole his name and made an MP3 player out of it, I guess Sune will be hearing from Microsoft Legal in the near future) and I lounging outside the conference center. Notice the ridiculously large badge around Sune's neck. Also check out included are a couple of pictures from the session.

posted on Monday, November 06, 2006 11:02:53 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

I arrived in in Barcelona yesterday and have been without net access for almost 24 hours. Yikes! :) Now, however, I've arrived at the conference center with my colleague where Microsoft kindly provides net access for the pre-conference attendees. We're currently waiting for the pre-conference sessions to start and I'm still undecided whether to see the AJAX session or the Agile Development with Team System session.

Stay tuned for "Tough  Choices in Barcelona". Coming up next :)

posted on Monday, November 06, 2006 11:35:31 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, October 26, 2006

Visualstudio_logoA while back I had some trouble with Visual Studio Team System and tests which suddenly couldn’t be run. VS simply marked them with a red icon and told med that the test in question is unrunnable. I was able to work around the issue by renaming the classes in my tests but that really wasn’t a very good way to go about it so I posted to the Microsoft forums at http://forums.microsoft.com.

A couple of guys from Microsoft were kind enough to respond but I never did find a solution to my particular issue. Now, however, Luis Fdez responded with a suggestion which I haven’t had a chance to try out yet, but I thought it important enough to post it here immediately if anyone else is experiencing the same issue.

Basically you should try to open the Test View or Test Manager and click Refresh which should fix it.

Take a look at the thread if you have any input or interest in the issue.

posted on Thursday, October 26, 2006 11:48:37 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

ARNETI had a pretty interesting issue with Data Dynamics Active Reports this week. Active Reports has proven itself to be a very reliable product with only a couple of minor issues which have been methodically ironed out by Data Dynamics so I was pretty perplexed to see this behavior.

Basically what happened was that I would instantiate a new Active Report, call its Run() method, and then nothing. Run() never completed and I was left with terminating the host process manually. Neat.

Luckily Data Dynamics forums came to my rescue and suggested that I add a reference to ActiveReports.Interop.dll to my project which I did and everything has been fine from that point on. I guess that at some point I’ve gotten the interop assembly from a previous version of AR deployed and my build was compiled with a newer version. So when I deployed I’d ended up in a situation where newer versions of all the other AR assemblies would reside in my bin folder along with the older version.

posted on Thursday, October 26, 2006 8:57:14 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, October 18, 2006

BusyHave long processes that your users aren’t patient enough to wait for? Live up their experience with a busy box. I had some problems with payment processing taking very long time to finish so I decided to do a little something for the user.

I would have used BusyBox.NET but sadly this was on an classic ASP 3.0 project so I had to use something else. For my ASP site I went with Mark Wagner’s BusyBox.

posted on Wednesday, October 18, 2006 9:46:27 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, September 27, 2006

Looks like some information about what we can expect to see in Enterprise Library is starting to surface. I’m pretty excited about the Validation Application Block which is something we need on every single project. If somehow we can get a unified model for validation between application types the world will be a better place for all

Read more on Tom Hollander’s blog

posted on Wednesday, September 27, 2006 1:04:23 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, September 21, 2006

Scott Hanselman blogs about his rules of thumb for managing exceptions. While I’ve never personally sat down and formulated my own rules, his does come very close to what I generally took for best practices. Great read for sure.

Good Exception Management Rules of Thumb

posted on Thursday, September 21, 2006 10:00:10 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, September 07, 2006

This is pretty interesting: A data access layer which requires minimum configuration and no custom code other than what you write actually access your data objects. Basically it sits on top of the SQL data store and generates classes which represent to underlying data structures complete with type for each and every column. Very nice.

Take a look at the project site on CodePlex and be sure to also check out the 20 minute demo which certainly wet my appetite.

posted on Thursday, September 07, 2006 3:37:11 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, August 16, 2006

That’s right Microsoft has finally deemed it necessary to release a service pack for Visual Studio 2003 .NET. This is great news as we still have a couple of projects around based on .NET Framework 1.1 and 2003 .NET. I’ve toyed with the idea of migration them to VS 2005 and using something like MSBee to target builds for version 1.1 but somehow the effort just doesn’t seem to be worth it to me which means I’m stuck with VS 2003 for better or worse from time to time.

Release notes

List of changes (the knowledge base article isn’t online at the time of writing)

SP1 download (153 MB no less)

posted on Wednesday, August 16, 2006 9:32:33 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Sunday, July 30, 2006

VisualStudioLogoMicrosoft has gone ahead and made the MSDN Library documentation free for everyone to download. Well done.

posted on Sunday, July 30, 2006 9:52:46 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Scott Hanselman reports the sad demise of NDoc and announces Microsoft's new project Sandcastle which essentially will take the place of NDoc. Unfortunately Sandcastle is in very early development and as such is in no fit state for production. Guess we’ll have to wait a bit longer for that snazzy documentation to be generated from our XML comments.

posted on Sunday, July 30, 2006 9:48:31 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, June 28, 2006

Ted Neward has a great article on Object-Relational Mappers or the Vietnam of Computer Science as he calls it. He lists many alternative solutions to different problematic areas which we all to some extent know instinctively are there but can’t quite put our finger on. It’s a long read but definitely worth it. You’ll be much the wiser for it.

My favorite part is his code for QueryExecution engines.

The Vietnam of Computer Science

posted on Wednesday, June 28, 2006 9:47:30 AM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Tuesday, June 27, 2006

Patternsandpracticeslogo

 

 

Finally something that looks like hard facts on how to create SO using .NET. At Vertica we’ve been working with this for a while now but I always feel that some kind of validation of our techniques would be nice. I can’t wait to dive into the guidance from the patterns and practices group.

For those who are new to the Service Factory, it's a collection of integrated guidance (including guidance packages, reference implementation and written guidance) to help you efficiently build consistent and high quality service-oriented applications on .NET Framework 2.0. Currently we are focusing most of our efforts on ASMX for the service interface, but we'll also be releasing guidance for WCF when this technology is released (and one of our older community drops includes an early version of our WCF guidance).

July Community Drop of Web Service Software Factory

posted on Tuesday, June 27, 2006 11:13:07 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, June 22, 2006

Visualstudio_logoEverybody should have a version control strategy so Roy Osherove’s post entitled A Simple Version Control Strategy Using Team System is basically a must read even if you don’t use Team System.

posted on Thursday, June 22, 2006 1:37:13 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, June 20, 2006

Darrel Norton has a very informative post called Seeing Double: An Unbiased View on the Benefits of Multiple Monitors which details an experiment they did where they put developers in front of dual monitors and watched the number of bugs and code churn.

Most importantly they saw the following numbers:

  • Productivity in lines of code per day increased 10%.
  • Defect levels decreased by 26%.

Very interesting.

posted on Tuesday, June 20, 2006 3:57:43 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Saturday, June 10, 2006

NETFwLooks like we can stop thinking about WinFX and concentrate on .NET Framework 3.0 instead. Somasegar announced that WinFX will be renamed to .NET Framework 3.0. Note that the CLR will still be 2.0 so no innovations on that front. Also worth of note is that this will not affect shipping dates in any way, seems pretty straightforward that it shouldn’t but there I said it

.NET Framework 3.0

posted on Saturday, June 10, 2006 11:18:53 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, May 23, 2006

ReSharper20FinalI was beginning to think that Jetbrains would never actually get ReSharper 2.0 out of perpetual beta. It seems though that that is just what has happend: ReSharper 2.0 is done and ready for prime time.

I sure will be taking this one for a test drive through one of our largest solutions to gauge the performance which previously has been a big issue.

Jetbrains ReSharper 2.0

posted on Tuesday, May 23, 2006 8:17:03 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, May 22, 2006

A new version of Cool Commands is available adding a couple of new … well … cool commands

  • Open Containing Folder for Files.
  • Copy Reference.
  • Add Projects from Folder.

CoolCommands 3.0 for Visual Studio 2005

posted on Monday, May 22, 2006 1:30:45 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Friday, May 19, 2006

Of course you knew that IIf is a method and not a language feature of VB.NET. Now did you also know that whatever you pass to a method is evaluated before the method actually receives it? This has all kinds of fun implications for the unknowing developer.

If you do any kind of development using VB.NET I urge you to take a look at VB.Net Tip: IIF is a function, not a language feature. It’ll save you some head scratching later on I guarantee it.

posted on Friday, May 19, 2006 2:10:31 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, May 17, 2006

LINQScott Guthrie is on a roll with posts lately. The last one is about databinding with the insanely powerful LINQ technology. I can’t believe how incredibly elegant this is. You need to go check out what the future holds for databinding and data manipulation in .NET in general. For more information about LINQ please check out the MSDN page for LINQ.

“I’m going to put together a few blog postings over the next few weeks that show off ways to use LINQ/DLINQ/XLINQ within ASP.NET projects.  This first walkthrough below will help you get started and introduce some of the important LINQ concepts.  You can follow-along by downloading the May CTP LINQ preview above and typing in the code below (I list all of it below), or you can download and run the complete .zip file of my samples here (note: you still need to install the LINQ May CTP drop for the .zip file of samples to work).”

http://weblogs.asp.net/scottgu/archive/2006/05/14/446412.aspx

posted on Wednesday, May 17, 2006 9:01:50 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, May 11, 2006

Visualstudio_logoMicrosoft was kind enough to release the Consoles font from Vista for VS 2005. I hadn’t noticed the first time around how nice this font is but it does actually make a difference when reading coding although it did take some getting used to before I was convinced. Give it day before you decide.

I highly recommend downloading and installing it.

Both Scott Hanselman with Consolas Font Family now available for download and guidmaster with Consolas Font Pack tuned me in to this one. Thanks.

posted on Thursday, May 11, 2006 3:03:54 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, May 09, 2006

ASPNETWebApplicationScott Guthrie has announced that Web Application Product 1.0 is available. Other than being a final version of the project we’ve come to love in VS 2003 it introduces a couple of new feature not available in any of the preview releases:

  • Team Build Support with VSTS: You can now perform automated and command-line builds with VS 2005 Web Application Projects and VSTS
  • Resource support with the App_GlobalResources directory: Strongly typed resource classes are now automatically generated for resource files defined with the ASP.NET app_globalresources directory (allowing you to program against these directly).  You can also alternatively define .resx files within the code-behind assembly of the project itself.
  • Custom Build Tool Action Support: You can now configure and define custom build tool action support for file-types within a project.  This was missing in the previous release candidate and prevented some third-party utilities from working.
  • Edit and Continue Support: You can now make code updates that apply immediately to applications while the debugger is attached and running (see walkthrough below for details).  This is supported with both VB and C# projects. 

Download Web Application Project 1.0. Be sure to uninstall any older version of the software you might have installed.

posted on Tuesday, May 09, 2006 10:49:07 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, May 04, 2006

Reflector.Diff2I’ve often sung the Reflector praise and today is no different. You sometimes end up in a situation with two assemblies; you don’t know which version is which and need to know specific differences between assemblies.

Enter the Reflector Diff plug-in by Sean Hederman which allows you to do text style diffs between two assemblies. A truly inspired use of disassembly and by  itself reason enough for the existence of Reflector 

Also be sure to check out Sean Hederman’s blog while you’re at it.

posted on Thursday, May 04, 2006 3:18:18 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, March 09, 2006

Code_logo_whiteIf you’re just getting started with ASP.NET 2.0 Dino Esposito has a great article just for you over at Code Magazine called Top-Ten Annotations and Remarks about the Wonderful and Powerful New Set of Features in ASP.NET 2.0. A great read for a heads up about some of the new features:

“You’ll still write a good deal of code in ASP.NET 2.0. Don’t completely trust those who say that ASP.NET 2.0 cuts 70% of the amount of code you’re called to write. You’ll end up writing more or less the same quantity of code, but you’ll write code of different quality. You’ll have more components and less boilerplate code to tie together pages and controls. Features like the provider model, data source controls, and master pages make coding easier and equally effective. But since there’s no magic behind, you have to learn the implications of each feature you employ. In the end, ASP.NET 2.0 comes with code behind, not magic behind.”

I liked this little bit of statistics:

“The core functions of ASP.NET are implemented in the system.web assembly. In ASP.NET 1.x, the system.web assembly counts 14 namespaces and 321 exported types. In ASP.NET 2.0, the number of namespaces grows up to 22. The number of exported types, instead, almost quadruples up to 1121 types. Do you still want to call it a major upgrade?”

posted on Thursday, March 09, 2006 8:57:52 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, February 23, 2006

When doing exception logging in our applications I’ve always needed additional information about the object which caused the exception. In my rush to get things done I created a new exception type which an ObjectData property which would hold my user data never thinking that my work might already have been done for me.

Sure enough, today I stumble upon the Exception.Data property which is new to .NET 2.0 and…. wait for it…. supports user data. It’s basically an IDictionary which will hold any number of objects for later use. Now I can through away my custom exception and be on my merry way with the project.

Sometimes it’s the little things that count

posted on Thursday, February 23, 2006 2:40:00 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, February 16, 2006

ASPNETWebApplicationVisual Studio 2005 introduces a new model for web based projects which is great but has some limitations for what I need to do. Basically I need to specify which permissions are needed to be able to access a specific web control using attributes.

ASP.NET 2.0 does away with class level members for each web control so I basically needed the old web project model back; Scott Guthrie to the rescue with Web Application Projects.

Basically you get the old model back with some of the new stuff from ASP.NET 2.0. Be aware that this is preview version. There are only a couple of minor annoyances present at the moment, i.e. you have to declare your web controls members on the class yourself and switching from code view to UI view using hotkeys doesn’t always work reliably. These are things you’ll be able to live with until the final version is released.

Download Web Application Project or read Scott’s initial post about it which includes a tutorial.

posted on Thursday, February 16, 2006 11:31:29 AM (Romance Standard Time, UTC+01:00)  #    Comments [2] Trackback

I was very fond of Whidbey Commands for Visual Studio 2003 so naturally I was disappointed when the features wasn’t included in VS 2005 as I originally assumed they would be. Anyway I discovered that Gaston Milano was kind enough to port his code to VS 2005 in the form of Cool Commands for Visual Studio 2005.

It adds the following features of which I find “Open Project Folder” and “Collapse All Projects” very useful:

- Reference Manager

- Collapse All Project, Command Prompt Here, Open Project Folder, Demo Font and Wheel Font Zooming

Check out CoolCommands for Visual Studio 2005 RTM, you’ll never know how you made do without it  Please note that you need to run the install.bat from a Visual Studio command prompt for it to work.

posted on Thursday, February 16, 2006 10:43:40 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, February 01, 2006

SnippetCompilerBetaSnippet Compiler is a tool I first learned about in the book From Coder to Developer by Mike Gunderloy. Basically it does what the name implies: Compiles snippets of code which is great for testing and debugging small pieces of code.

While version 1 was useful I didn’t spend a whole lot of time with it simply because there was no intellisense. Today, however, I took Snipper Compiler for a spin again and went to check for a new version on the website. Sure enough version 2 had popped up there and what a joy it is to use: Intellisense was added along with support for .NET Framework 2.0.

I’m sure I’ll be seeing a lot more of Snippet Compiler on my desktop in the future

posted on Wednesday, February 01, 2006 8:48:46 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, December 22, 2005

I passed my 70–320 Web Services with C# exam today. Luckily all went well otherwise my Christmas might have been poorer for it

872 of 1000 points, not too shabby either.

posted on Thursday, December 22, 2005 1:19:47 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, November 24, 2005

A post describing the use of Generics and yield to perform filtering a collection. Definitely will come in handy.

In this post, I'll try to show you why you should not limit your use of generics to strongly typed lists, and why yield may become your favorite new keyword.

Here's an example of how you can use both in a very simple piece of code.
Imagine you want to filter out an enumeration using an arbitrary function. For obvious performance reasons, you don't want to create a temporary list and filter that. You have to construct the filtered enumeration on-the-fly as the original enumeration is enumerated.
 
posted on Thursday, November 24, 2005 3:48:05 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

MsdnLogoWith Framework 2.0 out you should be reading up on all the new features of the Framework. Most notable Generics which you’ll be hard pressed to avoid for long.

Juval Lowy has a four part paper on Generics up on MSDN:

  1. Fundamentals
  2. .NET Framework
  3. Tool Support
  4. Best Practices

Happy reading.

posted on Thursday, November 24, 2005 2:30:49 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Check out Chris Sells site for a Smart Client version of Tetris for your gaming pleasure: Wahoo!

I know I’ll be visiting this one

posted on Thursday, November 24, 2005 10:21:54 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, November 09, 2005

Do you want to work for the best company in the world? Then you should know that my employers have an open position for a skilled .NET developer. We are a small company but have been experiencing healthy growth the last couple of years.

You’ll need your good sense of humor and great technical skills along with a drive to learn more about the latest and greatest.

Experience with the following products is a definite plus:

  • BizTalk Server
  • Commerce Server
  • Content Management Server
  • SQL Server
  • Analysis Services

You can read more at our website (Danish only).

posted on Wednesday, November 09, 2005 3:03:28 PM (Romance Standard Time, UTC+01:00)  #    Comments [2] Trackback
# Thursday, October 06, 2005

With Visual Studio 2005 just around the corner why not start looking forward to the 2007 release which work has already begun on? Take a look at the redesigned tabs which offer more information about the content and some kind of grouping functionality.

Tabicons1

Visual Studio 2007: File Tabs

posted on Thursday, October 06, 2005 2:20:07 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback

Looks like Visual Studio will be available real soon. Get ready to fire up your browser!

VS2005 RTM on MSDN 14th October!

posted on Thursday, October 06, 2005 1:58:37 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, September 22, 2005
With the release of .NET 2.0 imminent, it’s a good idea to keep in mind what the release will offer and more importantly what it won’t offer. Scott Guthrie’s post entitled VS 2005 Web Project System: What is it and why did we do it?. Solution and project files are an aspect of .NET which has always been shrouded in much voodoo-ness, Scott gives us the low down on the new approach.
posted on Thursday, September 22, 2005 11:33:33 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, September 19, 2005

LINQ (Language Integrated Query) enables SQL-like querying of objects, XML, and data from .NET languages, effectively making queries a first-class member of the .NET family. I just watched Anders Hejlsberg and it’s just nuts. I always get all worked up about new stuff, but this thing is truly something new and innovative, enabling developers to do complex data access with very little effort.

I’m deeply impressed with their solution to to this very complex problem, although I can’t help but wonder how the thing will perform. We’d seen most of what .NET had to offer when it was released in other languages, but this LINQ project is something I’ve never seen before.

Some keywords to watch out for extention methods, var, anonymous type.

In short, I want this, yesterday!

Take a look at the Channel9 video, it will rock your world.

posted on Monday, September 19, 2005 9:07:17 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Tuesday, September 13, 2005

It’s with some satisfaction that I’m able to fill this one under the “solved” section. I’m currently building a Reporting Services solution which generates price lists which includes images of products along with some other information. My dataset includes a column with a path for the image of a particular product, but I can’t be sure that the image actually exists in the file system which means that a call to System.IO.File.Exists is needed. Thus my trouble begins: The methods always returns false even though the file is accessible…. Hours of head scratching ensues until I find that Reporting Services includes its own policy file which doesn’t allow access to the file system.

A quick change to the file Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\rssrvpolicy.config makes all the difference in the world. Initially I gave RS FullTrust just to narrow the potential sources of error to a minimum, but FileIOPermission will suffice in my case. Specifically I changed the following node from

                    <CodeGroup
                            class="FirstMatchCodeGroup"
                            version="1"
                            PermissionSetName="Nothing">

to

                    <CodeGroup
                            class="FirstMatchCodeGroup"
                            version="1"
                            PermissionSetName="FullTrust">

Also do remember that we are deailing with XML thus case very muhc matters. "Fulltrust" does not yield the same results as "FullTrust".

posted on Tuesday, September 13, 2005 1:59:09 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, July 20, 2005

The long awaited EAP for Resharper 2.0 with support for both Visual Studio .NET 2005 and more importantly Visual Studio 2005 has finally started. The download weights in at 16 MB, quite a bit larger than the 1.x release. More to follow when I’ve gotten the sucker installed and taken for a spin.

The one thing which has been keeping me from really diving into .NET 2.0 was the lack of Resharper for VS 2005 so naturally I’m psyched about this release

Go download it.

posted on Wednesday, July 20, 2005 9:07:45 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, July 01, 2005

I’m very exited to learn that Microsoft is launching a project code named Atlas which aims to provide an AJAX implementation for ASP.NET 2.0. Scott Guthrie, program manager for IIS and ASP.NET, has some details in his post entitled Atlas Project where states that we will have tech preview as soon as the PDC in September.

posted on Friday, July 01, 2005 2:27:22 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, June 09, 2005

AJAX support will only be limited in the coming version of ASP.NET 2.0. Some controls will support refreshes using this method but it is implemented on control level and as such it’s not something you can get your hands on yourself in a easy manner. So it won’t make it this time around but you can go vote for it on the MSDN page for ASP.NET 2.0.

I already cast my vote, you should too.

posted on Thursday, June 09, 2005 2:58:19 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, June 02, 2005

For a while I wanted to have the template files of DasBlog HTML highlighted but I was unable to find the answer. Today one of my colleagues showed me the answer which involves a bit of tinkering in the registry settings for Visual Studio.

  1. Open HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\<version of VS, i.e. 7.1 for 2003>\Languages\File Extensions
  2. Copy the GUID found in the extension.
  3. Create a new key with the name of the extension you want highlighted.
  4. Paste the GUID you found in step into the value named (Default) and the your custom extension into the value named unused.

Thanks to the newest additional to the Vertica crew for that little tidbit.

 

posted on Thursday, June 02, 2005 2:15:40 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, May 16, 2005

Gears_an_originalA pretty cool server control which makes long page loads more tolerable for users from Mark Wagner. The control looks to be very easy to use and comes with full source code for those of us who like to tinker

“I have certainly experienced times; as I am sure you have, where after clicking a submit or search button I began to wonder if the web server was going to process my request successfully.  Why shouldn’t it.  I didn’t expect it to take more than a second or two.  Performing functions like a search, report generation, or the processing of a large order, can often take more time than we would like.  These predictably slow responding places in an application are ideal candidates for user feedback in the form of a processing message.  As long as your website is not normally slow, your users will appreciate being notified of potentially long running processes.”

[Building a Better Busy Box - Ver 1.2]

posted on Monday, May 16, 2005 9:46:56 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

TeamSystemLogoInitially I was very exited about Team System with all the nice integration features, testing capabilities, and just general coolness factor. I was, however, put off by the massive price of the beast. While I certainly understood Microsoft’s reasoning behind the pricing and licensing scheme, our small shop just couldn’t justify investing such a large amount of money in the product. So I quietly made peace with the fact that we’d never get out grubby little hands on the product.

Fast forward to today where I find a post from Rick LaPlante saying that Microsoft has indeed been listening to customers and come up with a “crippled” version of Team Systems for small teams like ours. Happy! Joy!

The crippled version is kind of like what you get with an Access database where performance goes to hell with more five concurrent connections. The small version of Team System will be included with each of the Team System roles and will support up to five users. Unlike Access I seriously doubt that Team System will work with more than five concurrent users though.

In any event this is certainly good news I go to get back into the game and get beta 2 installed for some serious testing.

Also noteworthy is the fact that upgrading from a single Team System role to the full suite is getting more flexible than initially announced.

“One area where we received a lot of feedback was from smaller organizations looking to use Visual Studio 2005 Team Foundation Server.  The ability to amortize the cost of the server over a large number of devs makes the Server exceptionally cheap on a per seat basis when you are thinking 20, 50, 100, 500 people per server.  However when you are talking about 3 people on the server, well we can all do the math.  To help address this issue, we will place a limited version of Team Foundation Server in each Visual Studio Team System role edition.  This version will be restricted to a maximum of five users and should serve the needs of smaller organizations.  Teams that have a need for more users should still find that Team Foundation Server is significantly more cost effective than current source code control solutions and offers tremendous value through its role as the core of integration across all of the Team System.”

Robert McLaws also picked up on the news.

posted on Monday, May 16, 2005 9:26:42 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, April 27, 2005

Refactor-logoFrom the creators of Coderush comes Refactor! a refactoring tool for every version of Visual Studio .NET. If you haven’t seen this thing in action yet you need to check out Carl Franklin and Mark Miller show off Refactor support in VB 2005 posted by Carl Franklin.

Many of the same cool visual effects found in Coderush are present and best of all the product is free for Visual Basic 2005. Of course I’ve found a friend in Resharper but I may have to give the Coderush / Refactor! a spin in the near future. One thing I was missing from Coderush when I first tried it out is the background compile-like feature found in Resharper. This is the one feature I miss the most when switching from VB to C#.

Also be sure to check out the official Visual Basic 2005 Refactor page on MSDN and the product page at DevExpress for the pro version with C# support.

posted on Wednesday, April 27, 2005 2:54:18 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, April 20, 2005

I was looking for a Bittorrent framework targeting the .NET platform a while back, however I couldn’t come up with anything searching around. Carl Franklin to the rescue with a post entitled Pwop gets new life where he mentions an application he’s writing which takes advantage of a C# Bittorrent library.

The framework is not in an advanced state at the moment but it looks like it’s getting there. I’ll be following the progress from here on in, maybe even donate some of my time.

Go check put Btsharp (registration required).

posted on Wednesday, April 20, 2005 1:00:59 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Wednesday, April 13, 2005

Enterprise Library is a wonderful thing but come deployment you may end up in a situation where you spend more time on deployment than actual development so here are the complete steps to take when deploying a Enterprise Library enabled application.

Note: For simplicity’s sake I deploy the entire Enterprise Library regardless of what is actually used in the application.

1) Copy the Microsoft Enterprise Library binaries folder to the deployment server, usually Microsoft Enterprise Library\bin.

2) Run either InstallServices On Windows.bat or InstallServices On WinNT.bat depending on which folder Windows is located in. They need to be place in the Microsoft Enterprise Library\bin folder.
This step runs installutil on a couple of the assemblies which in turn create performance counters needed for Enterprise Library to run.

Note 1) Be sure to create any databases you need. E.g. the logging database sink.

Note 2) You may encounter errors in the EventLog saying something along the lines of, “Access to performance data was denied to ASPNET as attempted from  C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe”. As you can tell from the message the ASP.NET worker prcess does not have access to the performance counters which luckily is easily remedied by following these steps:

  • Open the "Computer Management" app
  • Expand the "Services and Applications" section
  • Right-click the "WMI Control" entry & select "Properties"
  • Go to the "Security" tab
  • Expand the "Root" node and then select the "WMI" node
  • Click the "Security" button
  • Add the "ASPNET" (or which ever account ASP.NET is running under) user & give it access





posted on Wednesday, April 13, 2005 11:45:33 AM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Monday, April 11, 2005

As a follow-up to my post entitled Jetbrains .NET IDE I’d like to point you in the direction of Sneak Preview of ReSharper IDE which has just been posted on Jetbrains’ web site. This essentially seems to be a reply to my errornous post where a screenshot of the ReSharper IDE was mistaken for a screenshot of ReSharper 2.0.

Great to see Jetbrains on their toes. I’m liking this company more and more for every day which goes by. Their Omea product is helping that along as well. Expect a full review of both Omea Reader and Omea Pro.

posted on Monday, April 11, 2005 5:08:47 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, April 07, 2005

Jetbrains-logoNow here’s something really interesting. Looks like the screenshot I posted earlier is not ReSharper 2.0 but rather a new IDE in itself. Looks like the .NET community is getting a IntelliJ-ish IDE from JetBrains. VS is a great tool but it’s always great to have alternatives, especially if those alternatives force Microsoft to push the envelope on development even more.

NET IDE Forging Begins

Finally, those of you who have yet to hear the good news, we here at JetBrains have begun to hammer out our own .NET IDE, tentatively lacking an official name (we will have one soon, but if you have some suggestions, bring it to our forums!). If you are familiar with our Java IDE IntelliJ IDEA, we are going to be implementing many of the same navigation and usability features from this IDE into our own .NET IDE. Users can look forward to close integrations with VCS systems, industry leading refactoring support, powerful intelligence features, and a whole lot more. However, the final feature list is still under consideration, but you can start pushing for the features you would like to see in the IDE in our USENET group

Once more about the .NET IDE becomes ready for public consumption, I will be sure to pass it along to the rest of the community.

posted on Thursday, April 07, 2005 3:29:13 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback

I was looking around the JetBrains newsgroups and found a screenshot of ReSharper 2.0.Resharper20

Update: As stated in the comments this is in fact not a screenshot of ReSharper 2.0 but rather a whole new IDE being developed by JetBrains. You can read more about it in my post Jetbrains .NET IDE

posted on Thursday, April 07, 2005 3:10:06 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback

… or at least it will be eventually when they get a release put together. Right now there’s nothing more than a GotDotNet workspace but it sure would be nice to have now that Microsoft has announced the price of the Visual Team System.

NTeam will be an open source alternative to the upcoming Visual Studio Team System(r) and will utilize many existing open source applications such as NUnit, NAnt, and will link with various open source project, issue, and task management applications. NTeam will integrate with both proprietary and open source IDEs and will target small- and mid-sized businesses.

[NTeam: Workspace Home]

For even more information about NTeam please check out their forums where information about the Feature list and road maps is available.

At more than one occasion I’ve heard people from Microsoft state that a smaller version of Team System will be forthcoming which will suit smaller shops better both feature-wise and in terms of pricing. I wonder whether the NTeam team (?) will be able to put together a release before that, and even more importantly be able to match the features of this new version to hopefully come out of Microsoft.

posted on Thursday, April 07, 2005 8:32:07 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Introindigov1-001Great article on MSDN about Indigo complete with code examples.

Summary: Provides an architectural overview of "Indigo," Microsoft's unified programming model for building service-oriented applications. The paper covers Indigo's relationship to existing distributed application technologies in the .NET Framework, the basics of creating and consuming Indigo services, and an overview of Indigo's capabilities, including security, reliable messaging, and transaction support.

[Introducing Indigo: An Early Look]

Also be sure to check out Clemens Vasters’ mini series entitled A Weekend With Indigo which goes all the way from basic one way communication to more advanced concepts such as addressing.

posted on Thursday, April 07, 2005 8:14:00 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, April 04, 2005

Here’s something interesting for those of you interested in Reporting Services. Looks like Microsoft release some reports which grab information from the IIS logs to make reports of the activity on your web server.

The Microsoft SQL Server Report Pack for Internet Information Services (IIS) is a set of 12 Microsoft SQL Server 2000 Reporting Services reports that works with a sample database of information extracted from Microsoft Internet Information Services (IIS) log files. This database can be populated with your own data using the Log Parser included with the IIS 6.0 Resource Kit. You can use also the sample reports as templates for designing new reports.

Microsoft SQL Server Report Pack for Internet Information Services (IIS)

posted on Monday, April 04, 2005 2:39:56 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, April 01, 2005

The C# Team has scoured the Web for other implementations of the CLI, cool object browsers, IDE tricks, add-ins, obfuscators, and other useful tools and utilities that will help you get your job done faster.

Tools

posted on Friday, April 01, 2005 3:18:42 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

I just received an e.mail from Valentin Kipiatkov who posted the ReSharper 2.0 Plans. He states that while the upgrade for 2.0 is free for existing customers an adjustment of the price is expected for new customers. The new price will probably be $199 so if you’re contemplating buying ReSharper you should buy version 1.5 now and save $100 on version 2.0.

Upgrade to ReSharper 2.0 will be FREE for all customers of ReSharper 1.0 and ReSharper 1.5. The pricing for new customers is not defined yet and it's likely that it will be increased to, say, $199.

Even more information available in the post ReSharper Returns to Intended Price which states that the current price of $99 was temporary all along. The normal price for ReSharper is $149; all the more reason to go out and get ReSharper today. Even though it looks like VS 2005 provide much of the same, I can tell you right now that that isn’t the case. Running VS 2003 with ReSharper feel considerable more powerful than running VS 2005 without ReSharper. It’s that good.

Oh yeah, the $99 offer ends April 5th. Go buy now!

posted on Friday, April 01, 2005 1:34:07 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, March 31, 2005

I’m slowly getting started with digging into the world of service oriented architecture. Regular readers of this blog knows that a pretty fricking huge SOA project is coming up, so I need to be ready.

When I prepare for learning new stuff, I usually make a book my starting point to give me a solid foundation on which to build. Previous experiences have taught me that learning by reading articles on the net doesn’t work for me, there’s simply too much context switching going on for me to really grok the material.

On to the point of this post which is that I found a great list on Amazon called Service Oriented Architecture and Web Services by Michael Hoffman which lists a lot of interesting books of which I have to get at least a couple. The one book which keeps coming up in my research is Service-Oriented Architecture : A Field Guide to Integrating XML and Web Services so that one is a given at this point.

posted on Thursday, March 31, 2005 3:38:40 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

As a happy user of ReSharper 1.0 and general software update junkie I’m eagerly looking forward to the next version of ReSharper.

JetBrains has released a detailed list of new features found in the next release. Now we only need to know whether existing customers can upgrade for free.

Update: David Stennett of JetBrains says the following in the comments, “Yes, current ReSharper 1.X customers will upgrade to ReSharper 2.0 for FREE.”. Free upgrades for everybody, happy days.

Spam Bully could learn a lot from JetBrains if you ask me.

posted on Thursday, March 31, 2005 11:16:26 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

I’ve raved about Reflector many a times, so it’s only natural that I should point you in the direction of Darrell Norton’s post entitled List of Reflector Addins which lists … wait for it … Reflector addins

Among those i see myself using in the near future is Reflector.Diff and Reflector.ClassView.

Update: Looks like the site is hosted on a free service with a monthly bandwidth cap. Luckily tomorrow is a brand new month so be sure to check it out then.

posted on Thursday, March 31, 2005 9:10:29 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, March 16, 2005

Given that I’m about to suggest a logging solution for our coming development project I’m very interested in what Loren Halvorson and Tom Hollander has to say about Log4net vs. Enterprise Library. As of now Enterprise Library seems to be the better fit for our web applications, and the easy of extensibility is a big plus for Enterprise Library also. Mind you I have still to take a deep look at Log4net, and I certainly need to do a little test implementation to get a real feel for it. But as of now I’m going with Enterprise Library for our logging needs. Also the excellent integration with the Exception Handling application block gives Enterprise Library a leg up, it essentially does what I have done myself in a previous solution.

Read all about it in Microsoft Enterprise Library Logging Block compared to Log4net and Comments on the EntLib/Log4Net feature and performance comparison

posted on Wednesday, March 16, 2005 2:52:56 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Want to build something like those super slick web applications coming out of Google, like Gmail, or Google Maps? Part of the trick is using the XMLHttpRequest object and Javascript for request new data behind the scenes. I’ve used this technique to solve a problem on a large-scale traveling site here in Denmark. While you need to do some SOAP goo to get it working, it does work like a charm.

Interested in learning more? XML.com has an article about the subject by Drew McLellan entitled Very Dynamic Web Interfaces.

One of the classic drawbacks to building a web application interface is that once a page has been downloaded to the client, the connection to the server is severed. Any attempt at a dynamic interface involves a full roundtrip of the whole page back to the server for a rebuild--a process which tends to make your web app feel inelegant and unresponsive. In this article, I'll be exploring how this problem can be tackled with the use of JavaScript and the XMLHttpRequest object.

posted on Wednesday, March 16, 2005 12:00:12 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, March 15, 2005
As a follow-up to the Flickr API .NET Wrapper post, I’d like to point you in the direction of the Flickr API documentation which I neglected to mention last time around. Go have a look; for me just looking at the API makes all kinds of ideas surface.
posted on Tuesday, March 15, 2005 1:10:35 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, March 14, 2005

Paul Vick of the Visual Basic team responds to the madness surrounding the plead for Microsoft to keep supported VB6 and develop a new version.

To start with the second point first, to those who think we should integrate VB6 into the current Visual Studio shell, I can only offer the perspective of a developer who’s worked in both codebases: best of luck. In VB6, all of the pieces of the puzzle (compiler, debugger, forms package, runtime, etc.) were designed to work solely with each other and were tightly bound together. In Visual Studio, all of the pieces of the puzzle were designed to work with mutiple clients and were loosely bound together. Thus, the architectures are totally different and, in many ways, incompatible. Heck, we spent four years getting VB .NET integrated into the Visual Studio shell and we were writing it from scratch (and therefore could design a compatible architecture)! Trying to extract some of the pieces of VB6 and fit them into an architecture that was not designed to couple with them as tightly as their previous home would be a huge undertaking.

Save Ferris! I mean, VB6!

posted on Monday, March 14, 2005 9:17:29 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, March 13, 2005
Speaking of Flickr Derek Lakin, Sma Judson, and Ray Dixon have taken the time to write a managed wrapper for the Flickr API which enables you to do all kinds of tricks. You shouldn’t use the official release from the site, rather you should grab the latest version from their source control system as the release doesn’t work with the current version of the Flickr API. Save yourself the time I spent figuring this out. You will need the free SourceGear Vault Client for accessing their source control, and you should point it to scc.wdevs.com using user name “guest” and password “guest”.
posted on Sunday, March 13, 2005 11:08:40 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

I’ve started playing around with Visual Studio 2005 for a small Flickr project I need, and I’m really digging on the new ability to specify different protection levels on get and set accessors. I’ve often found myself needed a public get accessor and a protected or private set accessor. With .NET 2.0 I can have this with writing a separate internal set accessor. Small feature but it’s something I see myself using on a regular basis.

public string MyString

{

           get

           {

                      return "";

           }

           private set

           {

                      string s = value;

           }

}

Also: Generics… Wow! I want my next child to have this feature

 

posted on Sunday, March 13, 2005 9:06:22 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, March 11, 2005

I was struggling with solving an issue with a server control for ASP.NET which I couldn’t quite figure out. After much trial and error I finally pulled up good old Reflector and had a look at some of the control supplied with ASP.NET. This gave me some much needed inspiration on how to proceed.

Once again two thumbs up for Lutz Roeder for writing Reflector. I may have to write an ode to both of them one day

posted on Friday, March 11, 2005 1:41:42 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Should Microsoft continue to support VB6? No! Why? I’ll tell you why, or rather I’ll point you to Public Class GeoffAppleby where a well put together post sums up my feelings on this non-issue pretty well: Ranting about the VB rant

Be sure to read the comments too, they’re a hoot.

posted on Friday, March 11, 2005 11:29:25 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, March 04, 2005

Looks like we will be able to go live on Whidbey beta 2. Microsoft offers support from this version on. Here a quote from Wes at .NET Undocumented:

I came across a blog comment by a Microsoft employee, that the Whidbey beta 2 should be coming up in the next few days. This is a few weeks earlier than the the March 31 delivery date announced by Somasegar, corporate VP of Microsoft’s developer divisions, but still in line with statements made five weeks ago that the next Avalon and Indigo CTP, both dependent on Beta 2, will arrive in about “six weeks.” It’s about time.

More information about Whidbey beta 2 on .NET Undocumented.

posted on Friday, March 04, 2005 9:22:48 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
Sijin has written an article on Code Project on how the internals of the MessageBox works in .NET: Dissecting the MessageBox. Definitely a must-read if you want to get a feel for how the WinForms controls are put together.
posted on Friday, March 04, 2005 9:07:22 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, March 03, 2005

I’ve had a problem with the CInt, CDbl, CWhatever casts in VB.NET from day one. Maybe it’s just because I dislike VBScript so much that something carried over to .NET. I must admit that my preference goes to C# for it’s cleanness. The .NET framework was developed from ground up and this approach made it possible to start over and get rid of of the baggage which accumulates during the years a technology exists. Now why would you go ahead and add some of the baggage back in by adding VB6 compatibility on top in the form of VB.NET?

Understand me right, VB.NET is great but one of the things which bugs me about VB.NET are the choices made to keep many of the weird little “features” of VB6 in VB.NET. VB.NET is different in so many important aspects that it’s almost painful to think that anyone in their right mind would keep the little weirdnesses in for the sake of existing developers. I mean come on, they had to learn all kinds of OOP techniques, patterns, and so forth, why wouldn’t you just get rid of the weird stuff?!

Dustin Aleksiuk gives a great example you should be aware of if you are using VB.NET: The CInt cast. Take a few seconds and draw up in your mind the way you think it works. I almost guarantee you that the actual implementation will surprise you.

 

posted on Thursday, March 03, 2005 2:35:18 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Looking for more information about the Enterprise Library from the Patterns & Practice group at Microsoft? Each and every building block of the library will be dedicated a web cast giving you the opportunity to pick the area you have special interest in.

Enterprise Library Webcast Series

posted on Thursday, March 03, 2005 2:06:37 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

You should definitely check out Mike Roberts’ How to Setup a .NET Development Tree articles which details a good structure for your .NET project along with source control organization. Often I find solutions which are structured in a weird way and it annoys me to no end.

Mike did a series of articles on the subject and you can grab the whole thing in PDF format for easy accessibility. A must read for everyone who sets up new projects!

posted on Thursday, March 03, 2005 10:49:03 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
Along with the 30 Minute Regex Tutorial the Understanding Basic Regular Expressions article should give you a solid start into the wonderful world of regular expressions. Often I have found myself comparing regular expressions to SQL in that they both provide very elegant solutions to difficult problems, although getting at the solution may be more than challenging from time to time
posted on Thursday, March 03, 2005 9:15:42 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, February 28, 2005

Clemens Vasters posts a mini series about Indigo, a technology I’ve gained better appreciation of since learning that our first application based on service oriented architecture is in the pipes. Thinking about the problems we face in development using this architecture makes me want Indigo right away

Go read Part 1 Simple Messaging, Part 2 Fun with Messaging and Explicit Addressing, and Part 3 Hard-Core Messaging. Duplex Conversations your brain will thank you for the stimulation, I swear!

posted on Monday, February 28, 2005 1:52:40 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

My colleagues and I have been doing some Google optimizations on various sites we develop in-house and were discussing what the potential candidates for such optimizations might be. The unanimous answer is: URL rewriting.

Simply having the search term in the URL of the page will get you ranked very high on Google indeed. This being one of the technical factors which you can actually control as opposed to inbound links, it’s something I just don’t understand that every web site out there provide.

Since upgrading DasBlog to version 1.7 which supports URL rewriting I’ve seen page ranks for my posts rise significantly to the point where I’m listed on the first search page for several of my posts, though mostly on the localized version of Google. The main page would require inbound trafic from Robert Scoble to make even a dent in the ranks

Using ASP.NET it’s very easy to accomplish. Head on over the MSDN and read the article URL Rewriting in ASP.NET more information and code examples on how to accomplish this feat.

posted on Monday, February 28, 2005 1:17:35 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, February 24, 2005

Been wanting to get your feet wet with Visual Team System? Daunted by the outlook of lacking documentation and buggy pre-beta software?

Fear no more. David Bost has what you need: Installing the December CTP Release of Visual Studio Team System which is an article on MSDN on how you go about installing VSTS on Virtual PC software. I might even give it another chance, though I’ve pretty much resigned to waiting for a proper beta where more stuff works. Sure would have loved to have this article in hand when I first started installing the CTP

posted on Thursday, February 24, 2005 10:57:44 AM (Romance Standard Time, UTC+01:00)  #    Comments [1] Trackback
# Monday, February 07, 2005

I passed the exam last week but didn’t get around to mentioning it. Frankly I was surprised at the score because I never really feel prepared for these kinds of things but getting certifications in stuff you work with every day shouldn’t be hard, now should it?

So now I get to call myself a certifiable ASP.NET programmer … no wait! 

posted on Monday, February 07, 2005 2:14:15 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

I figured I’d post the compiled binary containing the code for uploading images using the MetaWeblog API for everyone to use. No need to make this stuff overly complicated. Also I’ve contacted Omar Shanine in the hopes that the code might get integrated in the main source of DasBlog.

Just download the updated newtelligence.DasBlog.Web.Services.dll and copy it to the /bin folder of your DasBlog installation and you should be all set. Testing has only been performed using BlogJet 1.5 with both default location and specific location of the binary files. Remember to give the ASPNET worker process write access to the folder you wish to use to store the images in.

posted on Monday, February 07, 2005 1:41:32 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
newtelligence.DasBlog.Web.Services.dll (96 KB)
# Friday, February 04, 2005

The provider pattern is central to so many of the new things coming out at the moment and in the future, such as Enterprise Library and ASP.NET 2.0, that you should take 5 minutes to read the article Provider Model Design Pattern and Specification, Part 1 by Rob Howard on MSDN.

posted on Friday, February 04, 2005 8:44:01 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Thursday, February 03, 2005

I’ve always found the MSDN webcasts to contain great information but I’ve always had a hard time getting at them. Not a problem any more as there is now a ASS feed available for upcoming webcasts. Be sure to subscribe today.

More details are available in the MSDN Events and Webcasts Developer Center Launches today post on the MSDN Webcasts Weblog.

posted on Thursday, February 03, 2005 9:17:47 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Every single .NET blogger out there has pointed out that Enterprise Library 1.0 was released some days ago. It’s an interesting release which bundles some of the existing application blocks together in a symbiotic package:

  • Caching Application Block. This application block allows developers to incorporate a local cache in their applications.
  • Configuration Application Block. This application block allows applications to read and write configuration information.
  • Data Access Application Block. This application block allows developers to incorporate standard database functionality in their applications.
  • Cryptography Application Block. This application block allows developers to include encryption and hashing functionality in their applications.
  • Exception Handling Application Block. This application block allows developers and policy makers to create a consistent strategy for processing exceptions that occur throughout the architectural layers of enterprise applications.
  • Logging and Instrumentation Application Block. This application block allows developers to incorporate standard logging and instrumentation functionality in their applications.
  • Security Application Block. This application block allows developers to incorporate security functionality in their applications. Applications can use the application block in a variety of situations, such as authenticating and authorizing users against a database, retrieving role and profile information, and caching user profile information.

Notoriously missing is the User Interface Process application block which should be included in a future release.

What immediately springs to mind (for me at least) is, “what is going to happen to the existing blocks?”. The answer can be found in the message board for the Enterprise Library workspace on GotDotNet where Tom Hollander says,

As blocks get incorporated into Enterprise Library, the old versions will become deprecated. We'll most likely keep them available online as archived versions for a period of time, but we'll be recommending Enterprise Library for new development. This won't have any impact on the blocks from a support perspective - our blocks are supported by Microsoft Support Services at the source code level, so you will be able to continue to get support for the old blocks once Enterprise Library is available.

So basically you must use the Enterprise Library rather than the application blocks themselves. I think that is an important point which isn’t readily available unless you do a little digging.

Guidmaster points out three articles for getting started with the new release:

The articles are all from @baz’ blog where even more information can be found.

posted on Thursday, February 03, 2005 3:16:08 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, January 21, 2005

Optimising web pages for the best possible page rank on Google is quite the black art. I really had no idea of how much time and effort that goes into this. It is of course understandable but a whole business has sprung up around it.

Not knowing where to start when I first needed to know something about the subject I of course consulted Google and got a couple of tidbits here and a couple tidbits there but never something I could call a true reference.

I wish I had known about SSW Rules to Better Google Rankings from the start. It’s a great resource with a completeness to it which I haven’t seen to date.

There are several other guides available on the site. I know I will be looking closely at a couple of them in the future :) Guides like Rules to successful projects, Rules to Better .NET projects, and Rules to Better code are sure to be of value to me.

posted on Friday, January 21, 2005 2:41:09 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, December 21, 2004

Just received my invitation for Meet Microsoft which will include lots interesting topics this time around including Team System and project management, Team System and testing, Overview of ASP 2.0, Overview of ADO.NET 2.0, and more.

For the first time I'm really conflicted, I really want to see all the Team System presentations but the schedule is arranged in a way which makes this impossible. DOH!

Oh well it'll still be really cool to see all the new Team System stuff :)

If you live in Denmark, go sign up now! Also there's a full program on that site.

posted on Tuesday, December 21, 2004 2:19:59 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

Having trouble with Regular Expressions? I sure did and I didn't want to spend a whole lot of time grasping it either so I've been trying to make to with what I could decipher from existing Regular Expressions which is a less than ideal situation in the long run.

Lately I have been devoting more time to the subject and today I found the must-read article for people wanting to get a better handle on Regular Expressions: The 30 Minute Guide to Regex Tutorial on CodeProject.

Go give it a read I guarantee you that you'll be a better person for it :)

Also when you get all worked up about Regular Expressions be sure to download The Regulator and Expresso which are two very nice tools for editing expressions. They help making the expression a lot more understandable. I've been using The Regular but am trying out Expresso for now.

posted on Tuesday, December 21, 2004 1:55:48 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, December 10, 2004
  1. Open Visual Studio without a loading a solution
  2. Go to Tools / Options
  3. Open Source Control folder
  4. SCC Provider
  5. Change the login name in the Login ID textbox (if the textbox is grayed out you need to close the currently open solution from the File menu)

From Visual Studio 101 series :)

posted on Friday, December 10, 2004 11:20:19 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, December 08, 2004

Anders Norås whom I've linked to in the past mostly due to some great posts about Team System, has the The geeky best of lists which among other thing include the top 5 tools for .NET development and the top 5 open source frameworks.

Also check out a previous post of mine entitled Ten Must-Have Tools Every Developer Should Download Now for even more great tools.

posted on Wednesday, December 08, 2004 9:31:52 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback

I missed this when I first posted about the Team System chat but it seems there was two parts to the chat held over to separate days so without any further ado here is part 1 and my post about part 2. Sorry about messing that up :)

As a little bonus I can tell you that there's a CTP of Team System coming out very soon so keep your eyes peeled for that. Be aware that the CTP builds are not beta quality but hey, in this day and age beta almost means production quality anyways, right? :)

posted on Wednesday, December 08, 2004 8:44:58 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, December 07, 2004

Ever wondered how to determine which version of the framework is installed on a machine? I did today when I had to do some debugging on a component I've written earlier; I needed to know the version of the framework and more specifically whether service pack 1 for framework 1.1 was installed.

To check for the service pack you need to do the following:

The .NET Framework version 1.1

With the .NET Framework 1.1, a new registry hive has been created specifically to make it easier to find the service pack level. Start Registry Editor, and then locate the following registry key:

Key Name: HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v1.1.4322
Value: SP
Data type: REG_DWORD

The data in the SP value tells you which service pack is installed for the .NET Framework 1.1. For example, if the value of SP is 0, no service pack is installed for the .NET Framework 1.1. If the value is 1, Service Pack 1 for the .NET Framework 1.1 is installed.

Note that this method cannot be used to detect if any hotfixes are installed for the .NET Framework 1.1.

If you want to know more about determining the framework version itself you can check out 318836 How to obtain the latest .NET Framework service pack.

posted on Tuesday, December 07, 2004 3:25:06 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, November 30, 2004

If you are serious with unit testing you need this plugin for Visual Studio (works with 2002, 2003, 2005). It allows you to right-click any project and test it either using the NUnit GUI, inside of Visual Studio, or using the debugger. Very handy tool to have around.

So where do you get it? TestDriven.net is the place but registration is required along with a 3 page survey but it's well worth it.

posted on Tuesday, November 30, 2004 8:55:53 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Friday, November 26, 2004
Ever wondered how to do unit testing on Windows Form Applications in .NET? You can find the answer at Thibaut Barrère's blog in his NUnitForms and TestDriven.NET post. As you can see from the post he is using a tool called NUnitForms which is like the NUnitASP framework for ASP.NET. Great stuff for sure.
posted on Friday, November 26, 2004 1:49:07 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, November 24, 2004
Just saw the post VBCommenter for XML Comment Generation in VS .Net 2003 over at the Powertoys WebLog which is about an extension for VS.NET 2003 which allows you to create XML comments in VB.NET. Of course you will not need this when VS 2005 is eventually released but until then you need this to get started with those XML comments.
posted on Wednesday, November 24, 2004 9:01:50 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, October 27, 2004

Need to show source code to other people in a nicely formatted way? The answer may be this extension for Visual Studio .NET which copies your code to the clipboard as HTML.

posted on Wednesday, October 27, 2004 10:02:32 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, September 30, 2004

I enjoy reading the Powertoys WebLog quite a bit, there are some real gems from time to time. Today was one of those times with a gem: Spell checkers for Visual Studio. I cringe whenever I notice a spelling error so this is the tool for me :)

posted on Thursday, September 30, 2004 8:46:20 AM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Wednesday, September 29, 2004

When I was first starting out using NUnit (read: a couple of months ago) I was using a class with hardcoded values for configuration of my unit tests. Of course a much smarter thing to do would have been to use the built in support for config files.

Say you want to test foo.dll, you would then place a foo.dll.config along side of the assembly and place the appropriate values inside the XML files in the appSettings section. Easy as that :)

posted on Wednesday, September 29, 2004 10:07:19 AM (Romance Daylight Time, UTC+02:00)  #    Comments [3] Trackback
# Tuesday, September 28, 2004
posted on Tuesday, September 28, 2004 12:34:14 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Here's a little tidbit about what the Connection Lifetime keyword does and why you need to understand it. I really had no idea, guess this is what makes blog so great, you get the word directly from the source :)

posted on Tuesday, September 28, 2004 9:52:54 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, September 22, 2004

Have you ever wanted to download the MSDN webcasts and listen to them offline? Well now apparently you can due to the effort put in by the folks behind Webcast Y where the goal is to keep a complete archive of downloadable webcasts.

Great initiative which I see myself using quite a lot.

posted on Wednesday, September 22, 2004 1:01:48 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, September 21, 2004

Anders Norås writes about another cool feature of Team System: Testing Code Coverage which basically is a way for the developer to determine whether a test covers all code paths of a particular method.

posted on Tuesday, September 21, 2004 9:53:20 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, September 15, 2004

One problem I encountered quite quickly while exploring Test Driven Development and Unit Testing is that there is no easy way to test methods which are marked as private. Of course this can be done with reflection and it was on my todo list to write a little testing framework making it easy to do but now it looks like I won't have to do anything as Team System will be providing the functionality out of the box.

Check out this post by Anders Norås which describes how you would go about doing it with Visual Team System which is included with the latest community build of Visual Studio 2005.

posted on Wednesday, September 15, 2004 12:55:44 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Friday, September 10, 2004

I am currently working on one project which called for the use of Javascript to call a webservice in order to do some processing much like the way GMail works. While it is possible to do to today with bare minimum objects like XmlHttpRequest and the likes, it's not the easiest thing in the world getting working.

Of course I was delighted to hear that ASP.NET 2.0 will support the technique more extensively than today. What is even better is that Fredrik Normén has had an article up for a while describing how to use the feature couple it with Karl Seguin's article and you get a pretty good idea of what will be possible.

As with any feature of Whidbey it may or may not change before the final product ships but I  am guessing that some form of this one will make it in.

posted on Friday, September 10, 2004 5:12:12 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Roy Osherove writes about a great experience he has had with Test Driven Development where his team basically had to do one of the most low level changes there is on a near-production ready system.

His story truly sums up the advantages of Test Driven Development when used correctly. In the near future I am going to entertain my colleagues with my very own dramatization of why we should be using TDD, I think this story will prove immensely useful to that end :)

posted on Friday, September 10, 2004 11:05:51 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, September 08, 2004

It seems that I am on a Team System roll here :) Next up is an article about the unit testing features of the product including code coverage and unit testing of web pages. Great stuff.

posted on Wednesday, September 08, 2004 8:44:14 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Yesterday I made a post about an article of an overview of Team System in which I mentioned a comment someone made about Team System being the difference between walking and riding your bicycle but I couldn't for the life of me figure out where I read it. Well Rob Caron was nice enough to both link to me and remind me that it was Jon Box who made the most excellent description about what Team System will mean to the development community.

posted on Wednesday, September 08, 2004 7:34:31 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, September 07, 2004

I stumbled on a comment regarding Microsoft Team System where the person compared TS with the difference between walking and riding a bicycle and frankly I couldn't agree more. It seems to me that a lot of developers out there are missing what TS promises to bring to the development process; this is especially true for small shops where the individual developer is mostly in charge of doing his or her own testing. Of course TS is so much more than testing, in fact I initially wanted to make this post to point you in the direction of an article on MSDN which gives you the bird's eye on what TS brings to the table.

posted on Tuesday, September 07, 2004 8:18:24 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, August 30, 2004

I found this via Matt Hawley: Global user controls, a feature which will be supported in ASP.NET where you basically register your control in web.config and you will have full intellisense on every page. I see many a menu control registered here in the future :)

In the near future I may have to get VS 2005 beta installed to check out some of this cool new stuff so that I may hit the ground running when it is released eventually.

posted on Monday, August 30, 2004 3:48:12 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Saturday, August 28, 2004

Last night I listened to my first live Dot Net Rocks!  show (http://www.franklins.net/dotnetrocks) and I just have to make a post about it because the experience was so damned cool. The topic was about coding with least privilege which I don't really see the point in being an ASP.NET developer and all.

I do see the benefits in writing and testing WinForm applications under least privilege. Anyway as you probably gather the topic was not too relevant for me personally what made the experience so great was listening to the bits before and after the show which gave me a totally different image of how it is to put together an online radio show, not an easy feat, especially not given the high quality of Dot Net Rocks!.

Topping the experience was the IRC chat room on EFNet where 70 or so people gathered during the show, asking questions and generally talking tech. Great stuff, I am sure that I will check in again sometime in the future even though I have to get up at 3 in the morning due to the time difference. At least the show takes place the night between Friday and Saturday here which makes it a possibitity :)

I guess you could say that I am hooked at this point :)

posted on Saturday, August 28, 2004 11:15:52 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, August 26, 2004

I have always taking for granted that you use exceptions for the "exceptional cases" not for stuff you would expect.

Anyways if you find yourself wondering when to use exception head on over to Memi.Reflection where there is a little discussion about the topic. He is right on the money.

posted on Thursday, August 26, 2004 10:19:44 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, August 09, 2004

I have been wanting to post about this for a while but have forgotten to do so. Roy Osherove did a really cool post on how to use Enterprise Services (which come with the framework) to simplify the clean-up after database testing.

He basically uses the builtin transaction support to rollback after each test is complete. This is definitely something I will be incorporating in my future tests of DAL components.

Anyway he has some great code examples you should check out if this stuff at all interests you.

posted on Monday, August 09, 2004 11:29:29 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

I use this tool all the time so it is great to have a new version to play. This version adds support for testing categories also a new overload for Assert.AreEqual was added which makes it easy to compare arrays. Believe it or not you had to do it the hard way by comparing all the elements of an array by hand in the previous version.

For a complete list of changes take a look at the changelog. You can download it from  Sourceforge.

posted on Monday, August 09, 2004 9:20:25 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, August 04, 2004

dalager wanted a way to toggle between code and design in Visual Studio using a single key. I found him an answer and thought I should post it here too in case someone else was in need of this.

This post on the Powertoys blog outlines a macro which you can use for that very purpose.

posted on Wednesday, August 04, 2004 9:45:07 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Following the trend from yesterday's post I decided to pimp another cool extension for Visual Studio .NET 2003: Quickjump .NET which enables you to quickly jump to a method, property, any member of your class essentially by choose that member from a filterable list.

Really nice if you have a class which contains loads of methods and properties like on the project I am working on currently.

This one even comes with full source if you want to get started with writing your own extensions.

posted on Wednesday, August 04, 2004 9:40:51 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, August 03, 2004

I just discovered this post from Gaston Milano regarding a plugin he has created for VS 2003 which includes some of the new commands found in VS 2005. They are all context commands and, to my mind, very useful:

File Tab

  • "Close All But This"
  • "Show File In Explorer"

Project Node in Solution Explorer

  • Collapse All Projects
  • Open Project Folder
  • Visual Studio Command Prompt Here

Download the package. You will need to install the Microsoft Interop Assemblies also.

posted on Tuesday, August 03, 2004 10:47:23 AM (Romance Daylight Time, UTC+02:00)  #    Comments [3] Trackback
# Thursday, July 29, 2004

I generally try to keep myself informed about trends in the business. While I don't see any projects on the horison which will actually use SOA I still find it useful to stay informed should the need for such a thing ever arise.

Now what made the whole idea of SOA click for me was 1) Listening to this Dot Net Rock! show featuring Clemens Vasters from newtelligence AG ( the guy who coincidentally created this blog engine and a very prominent SOA supporter ) and 2) Watching this video from TechEd 2004 Amsterdam called "The Nerd, the Suit, and the Fortune Teller".

Great stuff if you want to know what the fuss is about.

posted on Thursday, July 29, 2004 9:20:32 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, July 09, 2004

Just stumbled across a great article explaining the Gmail API. I was hoping that something like this would surface and now we have it. One thing which is keeping me from switching over to Gmail completely is the lack of integration in Outlook.

Maybe I should sit down this weekend and see what I can whip up :)

posted on Friday, July 09, 2004 4:03:22 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

The first link I posted for the webcasts turned out to be for internal use in Microsoft for burning DVDs only so the site was secured with login. Unfortunate for us who don't have a chance to attend the US TechEd.

Bink.nu has the same links all over again. This time I hope they'll stick :)

Architecture
Data Management
Developer Tools and Technologies
Management and Operations
Messaging
Mobile PC and Devices

Enough to keep us entertainment for some time I would think :)

posted on Friday, July 09, 2004 3:49:13 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Sunday, July 04, 2004

Scott Hanselman is always good for some great tips. In this post he talks about using NDoc for generating documentation from the XML comments we make in C#; God I can't wait till we get those in VB.NET 2.0.

Great post with some great info. You definitely don't want to miss this one.

posted on Sunday, July 04, 2004 10:21:32 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, July 01, 2004

Beta 1 of Visual Studio 2005 is available (and has been for a few days, have no idea how I managed to miss this). You may download it from Microsoft if you have a Passport account.

Also free versions of Visual Studio 2005 has been announced, the Express versions. They are available in beta 1 also. One of these versions stands out in my mind: SQL Server 2005 Express. In case you were wondering what the difference between SQL Server Express and the full-fledged version I got this from the product page:

SQL Server Express is designed to meet the needs of simple applications. Therefore, it is limited to using a single CPU and up to 1GB RAM, with a 4GB maximum database size. SQL Server Express does not include any of the advanced components of SQL Server including Analysis Services, Reporting Services, Data Transformation Services, and Notification Services.

Not too shabby considering that MSDE was the only free alternative a week ago :) There are Express versions of:

  • Visual Basic
  • Visual C#
  • Visual C++
  • Visual J#
  • Visual Web Dev
  • SQL Server
posted on Thursday, July 01, 2004 1:39:59 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Sunday, June 27, 2004

For those of you interested in TechEd 2004 US but did not get a chance to go the presentiations are now online. I think that putting the material online is a great idea, I enjoyed the PDC 2003 presentations as well.

posted on Sunday, June 27, 2004 3:03:12 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Sunday, June 20, 2004

Being a proud Dane the fact that another Dane, Anders Hejlsberg of Borland fame, is the mastermind behind C# is a great thing to me. Of course I am delighted that we can all get the word from the horse's mouth so to speak in the following videos:

Tour through computing industry history at the Microsoft Museum

What's so great about generics?

Programming data in C# 3.0

What influenced the development of C#?

Update: Reading a bit more on Channel9 I noticed a couple more videos featuring Anders Hejlsberg. Check them out:

Programming in C#

Managed Code

Anders Hejlsberg's Keynote Speech - Microsoft Visual Studio .NET Launch

posted on Sunday, June 20, 2004 4:07:13 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Saturday, June 19, 2004

Peter Provost held a seminar on building quality .NET solutions he posted the slides from the seminar. The slides contain some usefull stuff which you should always keep in mind when building applications. Also included in the archive is a PDF containing coding standard from IDesign which you can use if you are too lazy to sit down and create your own :) I pretty much agree with what they have put together in their coding standards.

posted on Saturday, June 19, 2004 6:07:36 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

A few weeks ago I learned abount Reflector by Lutz Roeder which is a tool for browsing assemblies - having downloaded and used it I can't for the life of me think of how I was getting by before :) This got me thinking that there must be a whole bunch of cool stuff out there just waiting to be found whihc is when I found ReSharper a tool which I have ranted about on more than one occasion :)

The reason for this post is that I just found a very nice article on MSDN named "Ten Must-Have Tools Every Developer Should Download Now". This is really what I was looking for back when I found ReSharper so I thought I would share it. Sadly ReSharper isn't on the list but it is still something you should take a look at. Oh yeah - I found the article via MSDN Just Released RSS feed. Nice feed, subscribe now!

 

posted on Saturday, June 19, 2004 3:32:52 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Thursday, June 10, 2004

Hot on the heels of yesterday's release a new version of ReSharper has been made available. Grab build 86 right now.

posted on Thursday, June 10, 2004 10:19:38 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, June 09, 2004

I am trying to beef up my testing abilities as they leave something to be desired. I immediately got caught on the idea that Test Driven Development would be if not the entire solution then a part of the solution. Only problem was that I really had no idea of what Test Driven Development is all about so I sat through a webcast from Microsoft on the subject. The presentation was James Newkirk a development lead at Microsoft and the man behind NUnit which is the defacto way of unit testing stuff in .NET.

The webcast gives a great overview of Test Driven Development and the ideas behind it. It even goes further and demoes how you would go about putting together some tests in Visual Studio .NET 2003. Please be aware that you need to provide a name before you will be able to view the presentation.

If you need some additional reading "Pragmatic Unit Testing in C# with NUnit" seems like the choice of books along with "Test-Driven Development in Microsoft .NET". My vote for which book is better is still out though.

Also there is a quite interesting article over at CodeProject.com on the subject.

posted on Wednesday, June 09, 2004 11:56:38 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

A new version of ReSharper has been released. Check it out. In case you are wondering what ReSharper is I have written a little something about it previously.

posted on Wednesday, June 09, 2004 10:02:15 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, June 04, 2004

I have previously mentioned CodeRush here which is an add-in for Visual Studio .NET which adds many of the things we will see in Visual Studio 2005. At $250 a license it is pretty hard to justify when the feature will be available for free in a years time.

While I was tinkering with CodeRush I stumbled across another tool named ReSharper which does the same thing - adds all the IDE sweetness which is found in the VB.NET IDE. ReSharper is still in development and the first release I tried was horribly slow. Today I got an e-mail stating that a new release is available. Not being impressed with the first release I figured I'd give it a whirl just for kicks.

Lo and behold the new version of ReSharper is actually a big improve over build 83 (the first one I tried out). Build 84 addresses the performance issues and also some of the configuration issues. I highly recommend that you try out the new version. Beware though the add-in is still in development and as such can be the subject of changes, breaking stuff, and all that. Consider yourself warned :) Also you should be aware that the performance of previous version decreased as the project size got bigger. I have not yet had a chance to see if this issue is addressed in the new version. If you do try out this build please let me know what you find.

Download latest build of ReSharper (build 84)

posted on Friday, June 04, 2004 12:32:37 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Thursday, June 03, 2004

One of the products I work with daily is Commerce Server 2000 and 2002 from Microsoft which is an interesting product trying to create a standard e-commerce platform on which you can develop your own solutions.

Anyway the product is very complex and has all kinds of nooks and crannies due to the fact that version 2000 was an ASP only product. Version 2002 has a lot of .NET classes and stuff to use but it is still just a layer added to the top of the COM objects found in version 2000.

I was tasked with creating a program which does some bulk updating using the Commerce objects. One of the tricks in Commerce Server is that it comes with a built in data abstraction layer called the profile system. A profile in the profile system is basically a table in SQL Server.

Back to the task at hand; I needed to create a ProfileContext outside of ASP.NET where it is available through a HTTP handler so I needed to figure out how to get at it without the HTTP handler doing the "heavy lifting".

First you need to add a couple of references to the COM based DLLs named ADODB.dll, AppHelper.dll, and MSCSCFG.dll. They are all found in your Commerce directory. Finally you need the managed Commerce Server runtime DLL named Microsoft.CommerceServer.Runtime.dll which is found in the Commerce Server\Assemblies directory.

Now for some code: First I needed to get the connection string for the profile system which I did in the following way: 

//

//  Get the profile connection string from the system config

//

AppConfig appConfig = new AppConfigClass();

appConfig.Initialize( ConfigurationSettings.AppSettings[ "name of your commerce application" ] );

Microsoft.CommerceServer.Runtime.IDictionary configDictionary = appConfig.GetOptionsDictionary( "" );

string profileConnectionstring = Convert.ToString( configDictionary[ "s_ProfileServiceConnectionString" );

 

//

//  Instantiate the ProfileContext object

//

string profileDefinitionCatalog = "Profile Definitions"; // You can look this value up in the Commerce Manager

ProfileContext profileContext ProfileContext( connectionString, profileDefinitionCatalog, new ConsoleDebugContext( DebugMode.Production ) );

 

posted on Thursday, June 03, 2004 11:03:32 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Saturday, May 29, 2004

I can't for the life of me remember where I found this presentation "Overview of the Tablet PC Platform" by Arin Goldberg but it's great both for getting to know what the tablet PC is all about and what the development possibilities are.

I for one am toying with the idea of getting one of these machines as the idea of being able to use a PC in a more natural way what with hand writing recognition and all is very appealing to me. Also being on the cutting of technology counts for something :D Anyway my idea is that I will get more reading done on the computer if I am able to sit comfortly in my livingroom while reading.

posted on Saturday, May 29, 2004 10:02:09 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Some time ago I discovered a neat language feature of VB.NET where you can name parameters for method calls. This is actually something which has been around a long time even before .NET (was there anything before .NET? :) ).

Named parameters is a feature you can use if you want to be really explicit in your method calls it does actually improve readability somewhat.

As an example I had to code a components which would do transactions on people's credit card for Bolia.com because they have way too many transactions each week for them to handle it all manually.

The interface I was programming against looking something like:

 

Function Capture(ByVal sAmount As String, _

                         ByVal sTransact As String, _

                         ByVal sOrderid As String, _

                         ByVal bForce As Boolean, _

                        Optional ByVal sAccount As String = "") As Long

 

You can use named parameters if you want to be really explicit in your method calls it does actually improve readability somewhat. In the case I mentioned I wanted to make it really clear which values were used for what in the method call like this:

 

            Dim amount As String = "11111", transactionId As String = "11111"

Dim orderId As String = "11111", forceCapture As Boolean = True, accountNumber = "1111"

 

Capture(sAmount:=amount, sTransact:=transactionId, sOrderid:=orderId, bForce:=forceCapture, sAccount:=accountNumber)

 

Unfortunately C# does not support this but I guess that it goes against the whole philosophy of C# anyway :)

posted on Saturday, May 29, 2004 9:46:05 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Friday, May 28, 2004

I just had to qoute this post from Scott Hanselman where he talks about CodeRush some more. For me the qoute hits the nail right on the head when it comes to the difference between C# and VB.NET.

When folks say that the differences between C# and VB.NET are "syntactic sugar" I like it.  Sure there are a few funky ; % & ^ things in C#, and every once in a while someone will add a new operator to VB.NET like "AndAlsoIsNotOnTuesday" but generally ifs are ifs and fors are fors, eh?

In case you were wondering CodeRush is a tool which helps C# developers be even faster than they are today by adding some features to the VS.NET IDE which the VB.NET developers have had since the inception of the tool but Coderush goes further than this and provides some of the features which are available in Whidbey (Visual Studio 2005).

Unfortunately it comes with a pretty hefty price tag for the at home developer so you better get your boss to pick this up for the office ;)

posted on Friday, May 28, 2004 1:49:57 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Wednesday, May 26, 2004

Now that Microsoft has announced the successor to Visual Source Safe what will happen to other vendors like SourceGear? Eric Sink of SourceGear answers that question.

posted on Wednesday, May 26, 2004 1:30:44 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, May 25, 2004

If you have ever had to design anything in VS.NET you know that at some point when you change from code view to design view or vice versa you will loose the formatting you painstakingly put together with no real way to get it back.

It is something which has annoyed me to no end and know I know why. Read this post at Mikhail Arkhipov's blog if you want to know more. There's even something which looks like a fix although you need to put your coding skills to use in order to make it work.

posted on Tuesday, May 25, 2004 9:54:23 AM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback

We finally have light at the end of the tunnel. Microsoft will release a replacement for Visual Source Safe which has been sourly needed for a long time.

Tons of other stuff than source control is provided by the tool (codenamed Burton) and you can learn more at ActiveWin where there are links for some demo videos or by checking out the product site.

There's even a FAQ available if you have more questions :)

posted on Tuesday, May 25, 2004 9:31:06 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, May 21, 2004

Here is a cool tool: A web-based Enterprise Manager. People coding PHP have had a tool like this for mySQL for ages in phpMyAdmin - a tool I used a lot back in the day when I was creating PHP based solutions like Telte.com.

Think I have to play around with the web Enterprise Manager this weekend :)

posted on Friday, May 21, 2004 1:27:51 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, May 19, 2004

We all know and love the C# version of foreach where you specify the type in the loop like this

foreach ( object o in list )

In VB.NET 1.0 you had to do declare the variable outside of the loop which is pretty ugly as you might end up using it later in your code by accident. With VB.NET 1.1 you can do a foreach loop the C# way which probably is the new feature of .NET Framework 1.1 I use the most :)

So in the old way you would do this:

Dim o As Object
For Each
o In list
Next

The new way allows you to use this form instead:

For Each o As Object In list
Next

Most people probably know this but I think it's worth mentioning for the 5 people who haven't discovered it yet.

posted on Wednesday, May 19, 2004 1:11:13 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Are you using a hidden column in your DataGrids to store the ID of rows? I was until recently when I discovered that you can specify a field on the DataGrid which contains the keys. It goes a little something like this

<asp:DataGrid id="MyGrid" runat="server" DataKeyField="TheFieldInDataSourceWhichContainsTheUniqueKey">...

In code you can retrieve the key in a command event handler or something similar like this

private void MyGrid_EditCommand( object sender, DataGridCommandEventArgs e )
{
  int id = ( int ) MyGrid.DataKeys[ e.Item.ItemIndex ];
}

Neat little trick which keeps your DataGrids a little bit cleaner :)

You can of course use any data type as the data key, just change the cast to the appropriate type and you're all set :)

posted on Wednesday, May 19, 2004 12:48:59 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Tuesday, May 18, 2004

My main focus for this blog is .NET which really isn't apparent when you look at the posts so I thought I'd add an entry about a nifty little language trick I picked up reading blogs last week :)

The @ is a really neat symbol which you use for making C# interpret a string literally. You probably written double \ more than once in a file path. Well with the @ symbol you don't have to do this simply write:

string s = @"c:\windows\Microsoft.NET";

Most C# developers know this but did you know that you can also do this:

string s = @"Line 1
Line2

Line4";

The text will appear just as you wrote it. Pretty neat :)

posted on Tuesday, May 18, 2004 1:02:11 PM (Romance Daylight Time, UTC+02:00)  #    Comments [15] Trackback
# Sunday, May 02, 2004

Of course .NET is not stupid - just the name of the product. While it does sound cool it's just not very user friendly in some situations. How many times have you needed to Google something and not been able to because .NET is treated as NET?

 

Anyway I have been adding a few new blogs to my blog list and just saw this post (or should I say rant) over at SecretGeek.com about the name of .NET. Man, I couldn't agree more :)

 

I am so glad that Microsoft decided to create a whole new language named C#. Always a good way to find .NET info on Google. Being bi-lingual I sometimes search Google for VB.NET specific stuff and I run into some of the some problems as with the generic .NET search term.

 

Oh well, I survive, but I can't imagine that the marketing people at MS didn't consider this.

 

posted on Sunday, May 02, 2004 2:34:23 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, April 30, 2004

Saw this over at guidmaster's blog and thought I'd give it a try to see if I could get to check out XDN :) So here's the offer for you guys:

FREE XDN Professional for .NET Bloggers during May 2004
Mike Schinkel, president of Xtras.Net, made an offer on his personal blog of a free XDN Professional membership (http://www.xtras.net/xdn) during the month of May 2004 for anyone that blogs about .NET frequently. If you are a .NET blogger, see Mike's post for how to get your free XDN membership.

posted on Friday, April 30, 2004 2:16:59 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, April 28, 2004

I am sometimes amazed at the lengths people are willing to go to get the job done. Take for example the simple task of getting a date from an input field. Some months ago I was working on a site which the original contractor wasn't able to get done alone so I got to take a peek at how the big businesses do their coding.

One of the things I found was how little the previous coders knew of the .NET platform - it was really obvious that these particular coders had lots of experience with ASP 3.0 but not much with ASP.NET. An example of this was when they needed to pull a date from a textbox - they accomplished this by doing two things: First assuming that the string entered would be formatted in a particular way and second by iterating through the string picking up month, day, and year parts of the date.

I did a little scounting around the SDK docs and found a much nicer way of doing this:

Dim formatInfo As New DateTimeFormatInfo()
Dim myDate As Date
formatInfo.ShortDatePattern = "dd-MM-yyyy"
myDate = Convert.ToDateTime(myDateTextBox.Text, formatInfo)

I am certainly no .NET god so as I am writing this I am wondering how much cool stuff I am missing in the .NET framework simply because I don't know enough about it?

posted on Wednesday, April 28, 2004 7:50:37 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Tuesday, April 27, 2004

Well maybe not the first .NET website EVER but it was for me :) When I was getting my feet wet with .NET (I was building the most horrible website in ASP.NET to learn the stuff) a friend of mine pointed out a site which he was involved in building. I saw the site and went, "oooooh, I want to build that kind of websites".

Today I started working on a new project which I wasn't too familiar with from the get go. I spent the entire day setting up my development machine and fired up the site. Lo and behold it was the same site as the one I saw almost two years ago. How freaky is that?

I just sat there and stared at the code while thinking about how the hell I had ended up in this situation. Sometimes it's the little things which remind you of how much you have learned :)

Anyway tomorrow will bring lots of interesting bits I need to get done. Can't really wait to get started for real :)

posted on Tuesday, April 27, 2004 10:10:27 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Friday, April 23, 2004

Ever wondered how to enumerate an enum? Well I did yesterday when I needed it to list the installed fonts on a system. It's actually very simple once you know how to :)

For Each s As String In [Enum].GetNames(GetType(System.Drawing.KnownColor))

colorDropDownList.Items.Add(New ListItem(s, s))

Next s


UPDATE: Found an article on Codeproject.com which describes even more tricks with enum. Go have a read.

posted on Friday, April 23, 2004 9:03:56 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, April 21, 2004

So the server needed another boot, back at it again :)

Just read this post on Neopoleon.com about a book called Coding Slave which you can buy at CodingSlave.com. It actually sounds like a pretty good book which was discussed on a previous .NET Rocks! Show (you absolutely *have* to listen to this show) where some pretty interesting conversation came up, not about technology in particular, more like a philosofical discussion about the biz, the people, and where it's all heading.

Anyways, I wanted to buy the book but CodingSlave.com doesn't seem to ship internationaly and Amazon doesn't have it (!?). So I shot a mail off the Bob Reselman an e-mail which I got this reply to:

Hi Søren:

Yes, I do ship to Europe.

The way that I do it is:

1. The reader sends me his/her address.

2. I figure out the freight cost via United States Post Office.

3. I respond to the reader with a total amount of book and postage.

4. The reader sends me, via email, a credit card number with expiration

date, exact name and address, etc.

5. I enter the card manually to my bank on this end in US Dollars.

6. Once the card is authorized for the total amount, I pack up the order,

run down Venice Blvd here in sunny Los Angeles to the Post Office.

7. I mail the package.

8. I destroy the credit card information.

Please let me know if you would like a book.

I hope to hear from you.

Thanks for writing,

Bob Reselman

So there you have no reason to not go and buy this book right now :) I am thinking that I will order my copy tonight. Anyone else from Denmark interested in the book? Maybe we could be really cheap and share the freight cost :D

posted on Wednesday, April 21, 2004 5:42:26 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback