Posts in category .net - page 21

Eight things I hate about Visual Studio 2005

While Visual Studio is quite a capable IDE it isn’t perfect – here is my personal top 10 list of things I hate about it. I’ve kept the gripes to the IDE itself – the issues I have with .NET Framework deserve a post of their own some time.

1. Go To Definition does not work between languages

Sometimes your solution has to be a mixed language one – you know the odd VB.NET class library that nobody wants to rewrite in C#.

Hit Go To Definition on a call to this library however and you won’t find yourself there in the VB.NET code – oh no it’s straight to the Object Browser for you.

2. IntelliSense ignores aliased name spaces

Name spaces were introduced to help reduce name collisions but occasionally you need to use both classes with the same name. You get two choices in .NET – you can either fully-qualify them making your code incredibly verbose and difficult to scan through or you can use an aliased name space – e.g. using SNM = System.Net.Mime;

Annoyingly IntelliSense will always use the fully qualified name even if you start with the alias. Typing SNM.ContentType content = new will trigger off IntelliSense to unhelpfully suggest System.Net.Mime.ContentType().

3. Dependent-upon project items aren’t usefully exposed

.NET 2 brought partial classes to the table and Visual Studio made a stab at using them for the Form designers by sticking the generated code in a .Designer file that nests below the file in the Solution Explorer.

This is achieved by the .Designer file gaining a <DependentUpon> tag to link it to its owner. If you want to use this for your own generated files you’d better get used to editing project files in Notepad because the IDE won’t help.

4. The SDK/AddIn API is awful

If you feel like addressing any of the shortcomings in Visual Studio you can extend it using their SDK which allows you to write your own AddIn – providing you can get your head around the most obscure and awful API ever.

5. Not all project types support automation

Some of the less popular project types (e.g. Database) don’t support the parts of the automation API they are supposed to.

This means if you’ve managed to get your head around the SDK you now find all your hard efforts don’t always work.

6. The syntax editor does not support italics

Why oh why doesn’t the syntax editor support being able to italicize a font? I’d much prefer my comments displayed in italics. If Borland’s Delphi supported it in the 90’s why can’t Visual Studio 10 years later?

My Envy Code R programming font fakes italics for use within Visual Studio!

7. Document tab area doesn’t like staying still

The document tab at the top of the screen is where you switch between the various documents. The only problem is it jumps up and down depending on how many tool bars as standard the designer/editor for that file type has so you switch once and then end up hitting a random tool bar button if you quickly decide to move on to another file.

8. No re-distributable elements

Want to put syntax highlighting in your product? Better go buy some third-party components.

Visual Studio style docking? Third party-component.

Sure you can license the basic Visual Studio IDE for your own languages and code – providing you have very deep pockets.

Wrapping it up

I’ve downloaded the January CTP of Orcas but I doubt it will address any of my bug-bears.

What would be cool is an open-source IDE for .NET development written in .NET that exposes the syntax highlighter and parser trees with a much better plug-in system and the Office 2007 style ribbon.

I wonder how the SharpDevelop guys are getting on…


LINQ in C# Web Applications

I’m a big fan of the Web Application type that was previously available as an add-on to Visual Studio 2005 but thankfully got promoted to a standard citizen with Service Pack 1.

So with a little more time on my hands lately I’ve been delving into the wonder that is LINQ – part of the forthcoming Orcas release of technologies.

For those who’ve been living under a rock LINQ is a set of extensions to .NET that let you perform queries on objects in much the same way you would do on a database with SQL (except the syntax is backwards by comparison).

Now while the LINQ Preview CTP installs LINQ projects for C# Class Libraries, Windows Applications and Console Applications it inconveniently misses-out Web Applications!

You can drop this ZIP file in your %UserProfile%\My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual C# to gain a new ASP.NET LINQ Web Application project type for you to start with as often as you like as shown:

Window of the LINQ To SQL templates available

Or if you want to modify an existing Web Application simply:

  1. Open up the .csproj file in Notepad and replace <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” /> with <Import Project=”$(ProgramFiles)\LINQ Preview\Misc\Linq.targets” />
  2. Add project references to: System.Data.DLinq System.Query System.Xml.XLinq

Hopefully more LINQ related posts as I get to grips with it.


My 2006 development tools

Christopher Bennage wrote about his development tool set-up and encouraged others to do the same so here’s my current set-up.

Daily tools

  • Visual Studio 2005 – IDE of preference despite it’s sluggish behavior
  • SQL Server 2005 Management Studio – Took getting used to but it’s an improvement on 2000’s Enterprise Manager
  • AnkhSVN – Subversion support inside Visual Studio 2005
  • .NET Reflector – Searching .NET API or to find out what it’s doing
  • Web Application Projects – Stop using VS’s web sites and start using web applications!
  • Web Deployment Projects – Deploy to dev, test or live servers as easily as building a project

Not quite daily

  • CodeSmith – Need to get to grips with v4 to build our whole database layer in one hit
  • Trac – Bug tracking, milestones & wiki with integrated support for Subversion
  • TortoiseSVN – Check-in/out of non-project items (e.g. art assets)
  • Web Developer Extension – Trying CSS changes on-the-fly, validating pages etc. from Firefox
  • Firebug – Examining pages, the page DOM etc. from Firefox
  • KDiff – Excellent 3-way diff tool that works great with AnkhSVN
  • Subtext – Blogging system running here

On occasion

  • Visual C# Express and XNA – Messing with 3D graphics, controllers and pixel shaders
  • Ogre – Steve’s object-oriented 3D engine
  • Xcode and Cocoa – Still quite alien with it’s message-based calling mechanism but obviously powerful

Keeping an eye on

  • Eclipse – IDE for developing Java (C++ and C# support in various stages too)
  • Ruby on Rails – Interesting RAD approach to web development – Apple also supporting on Mac OS X 10.5
  • Sandcastle – Microsoft’s documentation tool that already seems to have had an impact on NDoc
  • SubSonic – Build-provider that generates an ORM on the fly and provides automatic developer-only db editing pages

Not used lately, still installed

  • Delphi 5/6 – Borland’s great RAD tool for non-.NET development, later versions support .NET too
  • JBuilder – Java development although I’d probably move to Eclipse
  • Visual Studio 2003 – Still required for the odd .NET 1.1 application/testing


Adding depth to my programming ability

Elite on the BBC MicroI remember gazing at the screen of Acornsoft’s Elite in my childhood wondering what the code behind those 3D images looked like.

How did they rotate like that? How did it know which lines to hide? And more importantly where I can get a good price for this cargo hold of radio-actives and platinum?

Scouring through magazines, books and the library revealed nothing. Where on Lave was this elusive magic formula?

My attempts at reverse engineering Vu-3D shed no light and the web was still being conceived in Mr Berners-Lee’s brain so Google wouldn’t be able to exist for some time yet.

My programming continued on a more serious tract writing first silly hacks and demo’s, then utilities and into business software as an actual paid job. In my spare time I knocked out some other developer tools, utilities, drivers and even a Flash game of pool for a National Lottery.

3D remained the elusive beast long after the information became available to me. Matrices were not something my mind wanted to grasp a second time.

Then along came OGRE, written by a long-time friend of mine – Steve Streeting.

We’d actually hoped to write a game a long time ago when we were younger and less informed about how much work that would involve. The only thing that survived was the company name I still use for my consulting work – Envy Technologies.

Ogre looked promising. Object-oriented design meant it could hide most of the complexity and let me get on with high-level concepts and setting properties.

If only my degree wasn’t in the way!

Still I had a play and then the lure of Microsoft’s XNA came along.

Based on .NET Framework 2 and C# – the very two technologies I use day-in day-out to write those aforementioned serious apps. Write a game once and deploy it to the PC and Xbox 360 and from C# – a more enjoyable experience than the last C++ stuff I did (under DOS!)

XNA has been interesting to mess with at least on the 3D front. I’ve managed with not too much effort to plot a pyramid on the screen using co-ordinates I figured out, get it bobbing about a bit and changing the color via vertex and pixel shaders respectively and even get it and the viewpoint spinning round from the 360 controller.


From there on you find yourself soon needing features that aren’t there and you have to build yourself or acquire an engine to do it. The managed nature of XNA means that any engine you want to use will have to be specifically written for XNA itself – I guess Garage Games is hoping to cash in once XNA 1.0 gets out with their XNA engine Torque X.

Steve popped round this weekend for a chat about the usual geek topics we discuss I was very grateful that he lent me one of his complementary copies of Pro Ogre 3D Programming (he was technical reviewer and wrote the foreword).

I’m only at the end of Chapter 3 so far and with the exception of wondering what Scene Graphs were I’m still following everything.

Maybe I’ll be able to escape my 2D prison soon.