Dotnet Gets it wrong sometimes: 'mycontrol_ascx' is ambiguous in the namespace '_ASP'

by Jon 7. June 2010 16:27

When compiling larger more complicated ASP.Net projects which contain lots of user controls dotnet can get it wrong.  Im running the latest version of vs2008 with all the last patches but I still get occasional niggles.  Ive been getting an error telling me a control is ambiguous when I know it is totally unique.  The solution appears to be to tell the compiler to stop being quite so clever:

Find this, or a similar line in your web.config:

<compilation debug="false" />

Modify it and add batch="false", this stops the compiler being too clever.

<compilation debug="false" batch="false" />

Tags: ,

asp.net | General | vs2010


Developer Developer Developer South West #DDDSW

by Jon 6. June 2010 22:32

DDD SouthWest 2

I trundled down to DDDSW yesterday for a fantastic day of DDD geekyness.  The DDDSW team had thoughtfully laid on a Getting Started with .Net track I thought it would be a great way for my brother in law Kevin who is currently leaning dotnet to pick up some more skills.  Although the day was fantastic, I wasn't prepared enough, I need to remember to get alot more sleep before DDD events, as a consequence combined with the heat I wasn't in right frame of mind to mingle and chat as much as usual but I did talk to a bloke from Lincolnshire called Rob.

My Favourite Design Patterns, Gary Short

Yeah that was me, I was the demonstration!  No one else wanted to put there hand up, so a very tired jon went up and got my lefts and rights confused for a second.  Gary was explaining design patterns and how design patterns are used to facilitate leaning, they are a way of teaching people how to do stuff in a repeatable way without having to know the details of how the pattern works.  It was a great session.  I now know that my singleton pattern isn't as efficient as it should be, the singletons have written in the past have a couple of locks in them but I think I can bypass it with a static readonly:

class Singleton

    public static Singleton Instance
            return Nested.instance;
    class Nested
        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static Nested()

        internal static readonly Singleton instance = new Singleton();

What was nice about this session was that I kept on recognising patterns in my own code without knowing some of the official names of the patterns. I am using Garys design patterns without realising it because it seemed like the best thing to do at the time.

So you want to try scrum, Nathan Gloyn

Due to the number of true geeks at dddsw 2, this turned out to be a smallish session.  The way people develop and interact and the psychology of software development interests me.  In the past Agile, scum and other modern methodologies have been sold as something that can be achieved with a specific piece of software (which the person is trying to sell to you) or sold as something that needs to be done in one go (which the person can help you with through consultancy).  I disagree with this and I was very happy to see Nathan taking the same approach.  This was a very un-technical presentation of the building blocks of scrum, and given in a way that said you can get there in little steps.  I believe people get there quicker if they take small steps rather than a big bang change.

Scrum Board

Crap Code and the Disasters it Causes, Phil Winstanley

You have seen it before, every developer has seen it.  You join a project, you pick up some old code, or perhaps your working with someone, or perhaps it is you!  The code is scary, Phil went through some of the crap code he has seen in his travels and categorised the code into separate developer personality types.  Some of the code was very scary, some of the code was familiar and I may have even written some of it!  I understand the problems faced by developers that have progressed from vb within a single company, the world is a very different place.  In the past you sometimes had to fudge things to get them to work and habits die hard.  When your this kind of developer and your working on monolith of a project that was originally ported from 20 years old VB1 code there is fear to change things due to extreme spaghetti code.  When you have really old nasty missions critical code you learn from your peers not to change it too much.  I remember fixing some really code and a random appearing 6 months later for no valid reason.  Crap code is bad, but sometimes code is beyond repair, and attempting to fix it will also causes disaster.

Ajax with JQuery, George Adamson

George Adamson wrote some of JQuery so if you want to learn about AJAX with JQuery go see George.  A Great session it was a bit of a light bulb moment to see how query works in anger, AJAX is dead long live AJAX.  Microsoft has shifted AJAX development to JQuery so you really need to start using JQuery instead.  I'm not sure where this leave some of the control libraries such as Telerik?JQuery

Clean User Interfaces with ASP.NET Webforms, Dave Sussman

MVC is ok but it is relatively new technology, WebForms is tried and tested but know to generate messy html.  However was keen to show us if you turn everything off, turn the view state off, don't run with the .NET default settings and use dotnet 4 if you can and you get nice clean html.  WebForms isn't going to go away as it works, there are lots of sites and applications out there in the wild and there are other things in the pipeline for webforms such as MVP, that will only extend its life.DDD End, oh and the sponsers

All in all I had a fantastic day at DDDSW, a real credit to the organisers and I am already looking forwards to the next event.


Calculating IOPS per user in an Asp.net MSSQL System

by Jon 11. May 2010 09:52

I just had a customer contact me asking for read/write IOPS per user so they could correctly specify a SAN.  IOPS means I/O Operations per second, so they want to know how many disk operations occur under normal usage on a server.  

How do we find this out for a dotnet based system?  Well basic really when you think about it.  I logged into our development server and Started performance monitor and logged the background Disk Read/Write /Sec and wrote down the average values when our system wasnt being used.  I cleared the display and then started to use our web based system in anger, flipped back over to performance monitor and wrote down the new average Disk Read/Write /Sec values.  Subtracting the values I had just written down from the background usage of the server gives you the IOPS per user.

Tags: , , , , ,

asp.net | SQL | TechSupport


Uk Techdays

by Jon 8. May 2010 20:34


Uk Techdays Visual Studio 2010 Launch

UkTechDays; was 5 day events developer events hosted by Microsoft at two cinemas in London.  Although the usual goodies were lacking everyone had a great time and I learnt lots especially in development areas that I don't normally come into contact with. Credit must still go out to Microsoft for organising a week of free training/lectures, the quality of the speakers was really excellent.  Unfortunately the free copy of visual studio that delegates received at the both the vs2005 and vs2008 launches wasn’t repeated at the vs2008 launch in London.  But on balance what is most important is about keeping up-to date with the latest changes to the framework and development practices.

If you missed the event, or just want to catch up Microsoft has now made all the videos available here.

I attended the first two days, and took notes until I either got too excited or lost interest, this blog post is a regurgitation of these notes.  As I wasn't able to attend all week due to work and costs, these notes only cover the first two days.

Monday 12th April 2010 – First Day

I arrived in London the night before, and got to the Vue Cinema in plenty of time to get a coffee and get a good seat.

UkTechDays Introduction

Windows Development with Visual Studio 2010 - Matt Nunn, Senior Product Manager, Visual Studio

This session covered lots of new features that developers will benefit from in visual studio 2010

  • Partial String Intellisence - Intellisence has been improved, filtering now works with substrings or the Capitalised letters.
  • Multi Monitor - Windows can be broken off the Visual Studio Development Enviroment, and they can be moved to a separate monitor and docked there instead.  I think this will be great if you have 3 monitors but less useful for laptop based developers.
  • Zooming - Visual Studio 2010 has been rewritten in WPF so zooming is soother and the interface is slicker.
  • Test Driven Development Support – Useful if you have ultimate version of Visual Studio.
  • Extension Manager - Visual Studio extensions are now controlled from a funky new extension manager which appears to work more like a store where you can try, buy and remove extensions and features as you see fit.
  • JQuery - I haven’t used jQuery myself but I know a few people do.  jQuery is now properly supported in vs2010 and Microsoft is collaborating into the Open Source Project.
  • Lean Code Only - Some developer love code so much they don’t care about UIs.  Well Microsoft has now given us a way to develop in a code only view which hides away all the UI stuff. Great if you are writing drivers, or you are a proper geek.

Over the years C++ has been left behind in the visual studio world.  Vs2010 brings C++ upto date.  There was a fantastic demo on an old MFC application and how you can add windows 7 features really easily with visual studio 2010.  If you are a C++ developer VS2010 is defiantly an upgrade you should be looking at.  You get the class wizard back again, and you can do touch screen integration and everything else you would expect to see in windows 7.

Share point was also covered briefly; sharepoint development is much much easier in VS2010, but I think SharePoint is still too expensive for most developers to even consider so I won’t write anything else about it.

Web and Cloud Development in vs2010 - Richard Erwin, Technical Specialist, Developer & Platform Evangelism, Microsoft

There were a couple of demos, but I picked up the following nuggets on windows 7 phone:

  • UI Development for windows phone is vertical the XAML is shown side by side to the WUSIWYG editor.
  • Windows phone emulator is also hardware accelerated on the windows desktop (which is coo and needed because the windows 7 phone has 4 cores!)
  • Windows phone 7 is out later this year, sometime before Christmas

SharePoint and Office Development with Visual Studio 2010 - David Bishop, Principal Program Manager Lead, Developer & Platform Evangelism, Microsoft

I enjoyed this session, I get SharePoint but it’s not an area I work in and I don’t see the point for most developers due to cost constraints so I'm not going to write up my notes. Lots of developers started walking out at this stage, and there were lots of tweets from unhappy devs. However I thought it was a good session, and SharePoint may be something we want to get into later, especially if the cost is made less prohibitive.  If you do SharePoint development or your interested I recommend watching this video on the uktechdays website.

Improving Developer-Tester Collaboration with Visual Studio 2010 - Giles Davies, Technical Specialist, Developer & Platform Evangelism, Microsoft

Again it all looks great, but most developers can’t afford Ultimate Edition and lots of developers switched off. It is a shame as it is all good stuff but unfortunately we won’t get to use all these lovely features.

Unveiling the new and useful features of .NET Framework 4 and Visual Studio 2010 - Giles Davies; Richard Erwin; Mike Taulty; Eric Nelson; Mike Ormond; Mark Bloodworth

Ohh this was very meaty, it was split over two sessions reaching out until lunch because there were so many demos and so much information I’m just going to give brief bullet points.

  • Implicit Line continuation – No need to have those nasty underscores
  • C++ has a new dynamic keyword
  • Com Interops are better, comtypes are embedded in dotnet, ie a comtype library is no longer needed.
  • Web.Config and other config files have been imporved, we have different config files for different deployments.
  • Performance monitoring features, allows you to see what is going on in more detail it is a nice graphic display of how your code works. I think this is going to be fantastic for deep analysis of services running on multi core machines.
  • Caching in Asp.net is much more efficient
  • Session state can now be compressed
  • There is a new code block <%: which will automatically html encode
  • Webforms can now generate pure CSS friendly XHTML strick
  • Support for ASP.net MVC
  • Webforms isn’t going to be dropped, but It is clear MVC is going to be the recommended technology for web development.

Mike Taulty then took over and did a load of demos, RIA Services look fantastic, and defiantly something I want to look into in future

  • Visual Studio loves XAML based applications
  • XAML apps are made really simple if you want, you can write a Silverlight app without writing a single line of code if you want.
  • XAML is like windows forms point and click development, if you want it to be

Some other nuggets from the morning sessions

  • Entitiy framework 4 is a leap forwards as it fixes problems people experienced in older versions
  • Support for foreign keys on objects in EF4
  • You can take a group of properties and easily convert them into a complex type in the editor
  • If you use a stored procedure it will automatically create a matching complex type that works, which is a sensible outcome
  • Lazy Loading is on by default
  • POCO looks cool, but it isn’t in the initial release of vs2010, it is a code only interface to a database
  • In POCO you create a pure class, populate a few with data and save them to the database without writing ther database code
  • Parallel.Invoke will automatically split work across multiple cores efficiently

A Perspective on Agile Development - Colin Bird, Founder, Ripple Rock

It was a good session but you got the feeling Colin was trying to sell his services over demonstrating Agile best practices. I know I am not agile yet, but I intend to get there by continuously improving myself and our business practices. I am not going to big bang to agile I am going to get there in small steps. There were some great bullet points from this session:

  • Everything should be production ready all of the time
  • Agile is binary, it is either completed or not
  • Don’t commit part of the solution
  • Limit your work to what you have started and only do one thing at a time
  • Don’t Create a technical Debt
  • Lots of refactoring is needed all of the time
  • You need unit tests, performance tests regression tests
  • You need lots of interaction between people
  • Your aiming for Every bit of work you commit to be a mini waterfall. Analyse the problem, Design, Develop, Deploy and Test EACH time you commit changes
  • Look at implementing continuous integration
  • Agile is reactive to change
  • Encourage change and feedback from customers
  • Automate as much as possible, especially deployment try and deploy as much as possible

Fun Programming with Visual Studio - Rob Miles, Academic from University of Hull, Microsoft MVP

This was by far the best session of the two days. I am defiantly having a go at writing a game. XNA is a fantastic way into software development and it is something they should be teaching in schools across the country. Rob impressed the audience and showed us it is really simple to make a game that you can deploy to an xbox360, windows 7 phone or run on your home pc. His new book looks like it will be fantastic for beginners.

Tags: , , , ,

asp.net | conference | General | vs2010


Source Control is really blooming important

by Jon 3. May 2010 14:30

I cant stress enough how important and more importantly how useful source control is. If you are not using source control for your projects your essentially coding drunk. There is really no excuse as most is either free or very very cheap to get amazing features. Even if you are a one man or woman coder you should be using source control, as there are a whole heap of benefits:

  • You get a backup of your projects out of the box, if something goes wrong with your pc your safe (as long as your source controlling to a difference machine
  • You can see what changes you made and when and the reasons why, very useful when talking to customers or trying to find an issue
  • It makes you a better coder, with source control you get to see your changes and review them before you commit, removing mistakes or any test code you wrote
  • You can code with confidence, try ideas out and refactor with the confidence that you can always roll back to the last version you committed.
  • Patching, and quick fixes become a breeze. When you release a version of a website or system you can branch and keep a facsimile copy of what has been released. If you find a bug you can issue a bug fix rather than upgrading the entire system
  • If your company grows beyond one person, or you need to get development help you can easly hive some of the work out to anyone anywhere in the world

What source control system should we use?

There are a whole heap of source control systems available but we use a SVN based system. The other alternatives include SourceSafe, CVS, Team Server, and Mercurial (In the form of VisualHG), but we are sticking with SVN for now because it is stable and mature and works. As a source control system is the gatekeeper to your code it is important to have confidence in it, SVN is old enough for this and new enough to have lots of nice features. We will probably move to VisualHG in future, or team server but for now its not worth the leap.

So what software do you need to install?

Well it kind of depends what level of integration you want but here is a quick summary of what we use:

  • TortoiseSVN - Is the SVN client of choice for windows, it integrates into windows explorer and it is the only thing you need to get source control running. The best thing is it is mature, it is an opensource project but it has been running for years as SVN and before that for years as TortoiseCVS. This is the daddy of source control and its seamless integration into windows is fantastic. The best thing is you dont even need a server as you can run it against a file based SVN source repository without a server.
  • Visual SVN Server - SVN will work without a server, but if you want to simplify things and increase security this is a great server that just works. Again it is free but not open source, you dont need IIS as it will install its own version of Apache when it installs.
  • VisualSVN Client - If you want integrated source control in Visual Studio install this, it works in conjunction with tortoise so it is rock solid when it comes to stability. It has lots of great features when it comes to merging and branching, but it does cost. However at $49 a seat the cost is minimal to the advantages. You can download a free demo to see what you think, but you will make the small cost back in hours in increased productivity.
  • Stats SVN- Is a java application which generates html stats for a SVN repository. We run this every night to generate up to date web statistics on the project.

In summary install tortoiseSVN and see what you think, it will make you more productive.

Tags: , , , ,

development | SVN | vs2008 | windows phone 7

Powered by BlogEngine.NET
Original Design by Laptop Geek, Adapted by onesoft, and finally some tiny tweaks by JonAlb