Microsoft Visual Studio Installer Projects


I was forced to remain using Visual Studio 2010 and not upgrade to Visual Studio 2012 or Visual Studio 2013, because my company has dozens of internally used utility apps that use visual studio installer/setup projects. It just is not worth the effort to migrate to another installer technology.

Surprising, last year Microsoft reversed the decision to remove set-up projects, as politically the focus was on getting developers making Windows Store applications where the end product is submitted to Microsoft to host and manage. I write this post as I still come across developers that are unaware that this functionality has been returned.

You can download the extension package from here that updates Visual Studio 2013 only (not Visual Studio 2012)

Setup

After installing the extension you will see the project template available in Visual Studio 2013 shown below

Installer/Setup project

I am currently evaluating Visual Studio 2015 preview, so one naturally assumed that you would be able to create a new set-up project as the functionality had been returned in the previous version, albeit via an add-in extension, I assumed I could see the project template shown in the image above, but it was not there.

It turns out that Microsoft have changed their mind again, and decided not to include installer/setup project in Visual Studio 2015, article available here.

We’d like to thank you all for your comments on this UserVoice entry. We have been discussing the comments on InstallShield Limited Edition (ISLE) raised here with Flexera and we are currently working with them to address the top issues. At this stage we have no plans to include the former Visual Studio Setup Projects in future product versions but we will continue to work with Flexera and the community to ensure Visual Studio customers’ setup needs will be met with no-cost tooling that supports a broad range of scenarios.

Tony Goodhew, Program Manager, VS Pro.

 This is a very frustrating development, a decision based on political and not technical issues. it just means a whole class of Visual Studio developer simply won’t upgrade.

Great Windows Forms Sample Application


A Brief History

I moved back to client application development from ASP.NET about a year ago, thus already had the advantage of using Scott Mitchell’s excellent data access tutorials. These tutorials subsequently became the foundation of my approach to n-tier development in the smart client world.

When you start windows form programming, there really are quite a lot of books and blog/forum posts, that it can be quite hard to get your head around which approach to use when looking at application scenarios.

Even today, you have examples like Dinner Now or the more recent Stock Trader application which are great, but the learning curve is quite steep, and one needs to have been developing for a few years to reap any real benefit from these sample applications.

Visual Studio 2005 was released in November 2005, and it had the final version of Windows Forms, before Microsoft migrated its focus to Windows Presentation Foundation. This is the same Windows Form version in Visual Studio 2008 and will be the same in Visual Studio 2010 (Microsoft have made no announcement about any updates, even though they said they would continue to invest in Windows Forms – no updates for 5 years, nice).

Sample Application

The Outlook 2003 Look and Feel sample (click on downloads on the right) has proved to be an excellent learning tool for me, and provided me with a really good example of structuring my line of business applications.

What you get is a fully working sample application

OutlookUserInterface

I love the way the application is structured

Project

and you can extend this to connect to a database or web service with ease.

If you use a component suite like Krypton, you easily find you have an Office 2007 application within a matter of minutes. Judging by the leaked Office 14 (or Office 2009/10) images, you can rest assured that vendors will update their controls, and you will have the most modern and de facto business application UI.

I knew what a singleton was for example, but really came to appreciate when you need to use it in a application. There is also some Win32 wizardry, converting the standard tab strip into a navigation bar for instance, and in creating the other custom controls. If you choose to use the standard Windows Forms DataGridView control, you have examples on how to interact with the control, even to repaint the columns to achieve the layout you want.

All in all I love this sample application because it is a real world application, and the sample code is very extensible.

The Death of Windows Forms – Part 2


In a previous post, I was deliberating about whether to elect windows forms or WPF for an application I was writing. In the end I chose to use the products from Component Factory. The proprietor of said company (Philip Wright) has recently elected to construct a disquisition into WPF adoption. I have chosen to go a little further into reasons Philip states as problematical.

WPF Tooling

I agree whole-heartedly with Phil, it is immediately perspicacious upon opening up the Visual Studio 2008 toolbox, that the controls available are like “Old Mother Hubbard going to the cupboard and finding that it was bare”. Tim Sneath, a Group Program Manager for WPF has a comprehensive listing into the latest improvements in the WPF space, and you can see that controls are still the last thing being considered, as performance and graphics have been the priority.

The best example of WPF tooling is WPF/E, better known as Silverlight. The first release candidate is now available but why is this significant? The significance lies in the fact that Silverlight is a cut down version of WPF, and it is only now that it is beginning to reach completion. If a cut down 4MB version of something that is currently about 80MB (WPF assemblies) is only just nearing completion, you can safely assume that it will be some time before “completion” is reached for the far larger WPF libraries. That is the prime indicator of the work still left with WPF.

I must however disagree a bit with Phil on a minute point. Resource Dictionaries make it a breeze to skin or template all the controls in your application, so as more and more controls become available, then it is very easy to affect your complete applications look with literally a “switch”. The issue with WPF, is new types of controls. At present most vendors are recreating controls already available in windows forms, and augmenting them with WPF. Until the WPF toolbox reaches parity with Windows forms and new types of controls start to be created with WPF that are unachievable in windows forms, then WPF will be seen as playing catch-up.

WPF Applications

This is such an important point. I have lengthy but related posts here and here. Microsoft have always been in the Operating System and Server business, and relied on third parties to produce the eye-candy. The lack of applications is directly linked to why Vista (A WFP bedrock) has been received so poorly. As I’ve said in the links above, the same 100% of applications I used on XP, are the same 100% I use on Vista.

Probably the most widely talked about WPF application is the Lawson Mango application. It is important that my following remarks are not misconstrued so I must clarify that I would love to have worked on such an application.

The prime evocation to take from this application is that it is beyond beauty, and present applications do not compare one iota. This is a huge application, with the form count being around 10 000. It is very clear then that this was

  1. A money no object commission
  2. Technology and not business need driven (or mostly technology and a bit of business need)

For the average business application, resolving business need is the prime requirement. I am developing a Scheduling and BI application for a company, and the quite frankly, they couldn’t care less whether it was Windows Forms or WPF. Their prime requirements are

  1. Can you bring this project in under budget?
  2. Does it solve the business requirement?

One of the key factors that determines a software projects failure or success, is going over budget, and or not solving the business requirement. WPF is positioned disadvantageously here, because it is really very expensive at present to develop applications with the technology. If you get an accountant to do your requirements gathering and costing for a new or existing application, you will be shocked at how much more it costs to develop a WPF application, for no return on investment.

Another key factor in launching a business application is how easy it is to learn. An application that looks like Office 2007, will be far easier to train staff to use because the user interface is familiar hence intuitive. When you take the Lawson Mango application, and look at a company with 500 people and consider the ongoing training costs, then your budget for training goes into the many thousands, where with an Office user interface, that will be significantly reduced. Some might say this is boring, and you will always be stuck in the past, but to run a business you always have to look at the skills your current workforce have, and the return on investment that a specific technology will give you. It is for these reasons, that your typical business will prefer the Office 2007 UI in windows forms, to the Lawson Mango.

Supply Side Push

WPF will only gain popularity and mainstream recognition when Microsoft themselves release a WPF product. Obviously Windows 7 should contain more WPF applications and that will be a key factor in WPF adoption. What they need is a new Media Player done in WPF, or an application that is ubiquitously used in the operating system written “top down” in WPF. They also need to create managed wrappers available for both Windows Forms and WPF for the OS, unlike Vista at present.

Windows forms has already proven that it can create a good 60% to 80% of what is achievable in WPF, but as anyone that has ever developed a project of a decent size will tell you, writing software is very expensive, and unless WPF can start to negate the expense associated with it, for reasons aforementioned, it will continue to have a tardigrade uptake.

Easing .NET Framework deployment for Windows Forms and WPF


One of the real pains with deploying a .NET 3.5 application on Windows XP (OS of choice for business) is the fact that you need to install .NET 2.0, .NET 3.0 and .NET3.5 frameworks. The first two are plus 100MB, and the last is around the 60MB mark (last time I checked). Windows Vista comes with .NET 3.0 pre-installed.

This does cause headaches for IT professionals trying to deploy a new application, or if you write a managed application distributed on the Internet, users need to download and install all the aforementioned versions before the application works. This is cumbersome, awful first impression and bad user experience when starting to use a new application.

With the forthcoming Visual Studio 2008 and .NET framework 3.5 service pack around the corner, a new feature called ‘client profile’ has been created. This, in a nutshell, removes all the extraneous libraries a client application does not use, like ASP.NET for example, and retains the most common client application libraries for both Windows Forms and Windows Presentation Foundation. A step by step tutorial is available here.

ClientConfigs_web_2

The total file size will be around 27 MB, which is tiny, and will please all the IT departments no end, that have to deploy managed applications either locally or distributed. Even if you have just a .NET 2.0 application, that is around 120MB in size, so you immediately shave off 100MB in the install. I must reiterate, that this affects both Windows Forms and Windows Presentation Foundation, and you can ease deployment for both presentation layers. You will reduce the install imprint of you application by at least 400MB and save at least 30 minutes at the start, while the client machine installs .NET 2.0 then .NET 3.0 and finally .NET 3.5 (with the restarts in the middle).

Repeater control for windows forms


Visual Basic Power Packs 3 was released about a month ago. I passed by it primarily because of the ‘programming language’ in the title, I am a C# developer through and through. This new power pack has a new repeater control which is very very good. Best of all, is that it is available for both Visual Basic and C# developers in the Visual Studio IDE, despite the Visual Basic title. Just follow the installation instructions and it will add the components to your toolbox.

UPDATE September 2008

The new power packs are now available in the Visual Studio.NET 3.5 SP1, so if you have that installed, then there is no need to download the power pack separately.

Windows Forms still ahead of WPF in LOB applications


Just reading the roadmap from DevExpress

http://www.devexpress.com/Home/Announces/Roadmap2008.xml it is pretty clear that that sales for Windows Forms are still very high. This has meant that investment in the Windows Forms platform is to continue.
The principal problem with WPF for LOB applications, is that you need to pay for a designer, and they do not come cheap. In a six month turnaround application, that can easily be £60,000, or much much more. With most LOB applications, you purchase presentation layer components from Infragistics, DevExpress, Component One etc, and your developers thrash out the necessary business logic with the Office 2007 UI or whatever UI is flavour-of-the-month.
Because Microsoft have just created the fluent interface in the Office 2007 ribbon, I cannot see a significant change to this UI in the next office version. Office is still written in C/C++ and I don’t see a re-write for the next office version. As a result most applications written in windows forms today will continue to be relevant. Look at Visual Studio, the toolbar components are pretty much the same as Office 2003, even down to the icons that have not been changed for years. Visual Studio is a tool, and most LOB applications are tools.

Differentiated UI is a big risk in LOB applications, because you usually have a workforce with varying IT skills. You can safely assume that most users are familiar with Outlook, so creating an application with a similar look and feel lessens the learning curve. WPF opens up new doors, and for me in LOB applications, only the subtle use of it with nice 3D charting or reports is the way to go. If you move to far away from the familiar, you will end up with users struggling to learn the application. The net resultant is increased training costs for the application, for no real business value.

Finally, An example of a Multi tier architecture for Linq to Sql


Update 2/6/2008:

The original post for this is available  beneath, but the link to the original article has been removed which turns this post to a pointless rant because you cannot reference the article. Luckily Beth Massi has a very good n’tier Linq example.

Original

Anyone that is aware of my posts knows that I do whinge about the lacklustre implementability of Linq in real world scenarios. I have battled with this for some time now.

Microsoft’s response a few months back was that they were waiting to see how their customers would ‘conjure up’ a method of doing this.
I found this attitude dissatisfactory, because if you’re trying to negate the impedance mismatch between ‘objects’ and ‘data’, the ubiquitous scenario is n-tier. You cannot introduce such a feature (Linq), and not have examples of it being implemented n-tier.
I have just come across an example of implementing Linq to Sql on MSDN. The link is available here.

I have finished testing this and quite frankly, I’m very disappointed. This is not easier than datasets, but more complex, for absolutely no ROI for understanding the raised abstraction.
Validation is pain, even more painful is moving this to winforms/wpf applications, that do not have the object data source.

I keep returning to Linq because of all the noise Microsoft made. Indisputably, one is more expressive when composing queries, but that is just one small part in creating an n-tier app.

Nah, back to datasets for me, and quick. Unless a miracle happens.

Beware of 3rd Party RAD controls


Recently I have been involved in a discussion about 3’rd party rapid application development tools. The users wanted to know about Telerik controls.

Telerik are very new to the Windows Forms game as they have always been web giants. For a recent application, I needed a grid that displays progress bars/department progress as an order goes through various departments. Only problem is with all the main vendors they have heavily modified their grids to cater for 10 000 different situations. The net result, is that you have 10 000 options to learn, to fully utilise their grid. Personally I found that the DevExpess grid for instance, is optimised for databinding, and does not have an unbound mode (after a month of fiddling about with it). For all the others I needed to owner draw the progress bars, which I may as well have done with the standard datagrid view. I have now done this, and optimsed it though, getting rid of the flicker when painting.
The feature I do miss is grouping, and this is what most people that buy RAD components go for, i.e. getting their app to look like Outlook. I will be modifying this grid and adding a Linq data source. All in all, it will take me less time to do this, than learn third party vendor solutions, and improve my development skills. You automatically, in fact exponentially raise the complexity level when you use third party suites, when a lot of the time, not being lazy and working a little harder results in attaining what you wanted without the huge complexity overhead.

2 years down the line, you have to maintain the application (I want to move to WPF), you then need developers that are trained in whatever suite you used and that really does add to the costs. The only third party thing I will purchase will be a calendar/scheduler because I really haven’t time to update the open source ones and I need something that looks good.
You can say what you want about Krypton, but this I have found to be highly customisable with things like button specs. It is far, far, far more flexible than some of the main vendors, and I have tried them all.

One of the main complaints I receive from customers, is when using solutions like RedPraire. The main complaint is, that you are tied into their specific implementation for your business, i.e. you work around the system and not the other way around. This is no different with software from 3rd party vendors. Your are tied to their specific implementation of for example how a datagrid should work. Try 2 different vendors and get 2 completely different grids and abstractions. Just like windows forms the drag and drop experience is quick (dragging components onto the form), then the real challenge begins in learning the various abstractions.

Use third party components, if you have a substantial budget, and have 4-5 years programming experience. Without that, you will never fully utilise what’s on offer, and never know how .NET really works, because you are shielded from using delegates and interfaces.

Linq to SQL Compact Edition (CE)


I got asked about doing this recently, and needed somewhere to point the individual to.

Presently, unfortunately, Linq to SQL Compact Edition is unsupported. Luckily though, it is quite easy to still perform Linq queries against SQL compact using the command line utility SqlMetal. SQL Compact Edition is very handy for single user applications or demos where you want to retain a very small application imprint, but not lose functionality. All that is required is that you have the object relational mapping (ORM) file that contains the Linq to SQL classes. This in Visual Studio is the .dbml file that is generated when you elect LinqToSQLClasses in the data menu.

Open up the Visual Studio command prompt by going to

You should have the following;

C:\Program Files\Microsoft Visual Studio 9.0\VC>

Enter ‘SqlMetal’ in the command prompt and take time to explore all the options available to you.

I simply want to create a .dbml file from my database which I have in my c:\ drive. You will want to point this to wherever your .sdf file is.

Enter the following path into the Visual Studio command prompt

SqlMetal /dbml:c:\Users\MyName\Documents\Northwind.dbml "C:\Users\MyName\Documents\Visual Studio 2008\Projects\Windows Forms\Code\Northwind\Northwind Database\Northwind.sdf"

Where the above is the format; SqlMetal /dbml:northwind.dbml northwind.sdf

Note that in vista you must specify the path through the ‘Users folder’. Failure to do this will result in a file access error.

As you can see my .dbml file was copied to my documents folder. I then copied this into my project. .To access the file I reference it in the constructor of the form thus;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        NorthwindDataContext northwindDataContext;

        public Form1()
        {
            InitializeComponent();

            this.northwindDataContext = new NorthwindDataContext(Properties.Settings.Default.NorthwindConnectionString);
        }
    }
}

The Death of Windows Forms?


I have been engineering software for about 4 years now. For the most part I have used Windows Forms and ASP.NET (the latter being my focus hitherto).

Presently, I have a little sideline project, that may or may not be remunerative. This ‘sideline’ will be a smart client. The principal requirements for this project are two fold.

  1. A Microsoft Outlook type interface, with a grid control that has grouping.
  2. A grid control that is similar to uTorrent, Free Download Manager or FlashGet. This grid will have an array or progress bars.

Because this project, which I’ll code name “Chronicle” is not commissioned, its is best met with free tools. At present it is in three incarnations.

  1. Using free components from http://www.componentfactory.com/. I have used just the free toolkit from here
  2. Using the exceptionally good components from Devexpress
  3. Using Windows Presentation Foundation

So far the need for the project to be free has ruled out Devexpress components because they are

  1. Very expensive
  2. Add additional layers of complexity to the project. Just try to get you head around the Xtragrid, their version of the data grid view. This is not a pleasant experience, and comes at the expense of a few months to master.

The two left, are the Windows forms application with Krypton, or WPF.

I was asked this question in for forum a while ago;

What drives change in your organisation? Technology or Business requirement?

I have since struggled to answer it. Business requirement tells me that winforms is the way to go, but WPF makes things so much easier. Trying to embed controls like progress bars into data grid views requires some tricky code.

To get a faithful Outlook UI in winforms, there is the Joe Stegman sample titled Building Outlook UI in 100 lines of code with Winforms (link to the video on channel 9).

This is probably the canonical example for doing this type of thing in winforms. Only problem is that there is no grouping in the datagrid, that has been heavily modified. In WPF you just set a few properties to a Listview control.

To get a faithful Outlook UI in WPF, there is this example. Both examples lack the WOW and exact finish that Devexpress or Infragistics components have. But they teach you the principles, you can iron out your business logic, then either be creative or purchase presentation layer components.

In WPF you can add any control into any control, a huge obstacle to my project in windows forms.

In WPF to enable spell checking you do this;

<TextBox SpellCheck.IsEnabled=”True” />

In windows forms you either go with Netspell (4 years old) or this, which does not work on my PC because I’m using office 12. More tweaks required there then.

I put this question to some of the finest minds around here.