Web browsers and things on the web
11 Apr 2011

Community Night: BE THERE

Clipboard01Tomorrow is another community night, and I realised that there is MANY people who do not know about this fun event. This is a gathering of communities (or user groups or interest groups if you prefer) who meet on a regular basis. This is a totally free event which takes place the 2nd Tuesday of every month at Microsoft’s offices in Bryanston.

*Yawn* another Microsoft marketing session? WRONG! This is run by communities and Microsoft has NO say in the content or agenda, unless a community allows them Smile with tongue out Microsoft is really trying to help all communities by providing the facilities – not the content!

MobiZATo give a concrete example MobiZA, a user group focused on mobile development is doing a session on Android! talk about not Microsoft marketing there!

There is also a variety of communities in a attendance so you can also see things you would not have seen before, for example the business user group or the game developer group! And of course there is plenty of corridors for interesting discussions and some even contain food & drinks!

Hopefully I have given you a taste of what is in store and why you should attend and you can find more details on the DPE team blog.

mapFinally, if you have a user group maybe you should think of joining us at community night? Free venue, projectors, seating, food & drink. Plus plenty of people attend, could be a great way to grow your group. I would personally love to see some Linux & PHP groups there because it would allow those who have not had a chance to see the non-Microsoft world an opportunity and hopefully learn that it isn’t so cut & dry out there.

Remember, tomorrow 12th April 2011 @ Microsoft (map to the left) from first sessions kick off at 16:30 and second sessions get started between 17:30 & 18:00!

07 Apr 2011

DevDays - The event for Microsoft Developers

imageIt’s that time of year again, it is DevDays time again which is the premier conference from Microsoft for developers! This year it is a very different beast from previous years:

  • Cost: For the second year, you’ll need to pay. This year it is R350 and that is excellent value for the event.
  • Cape Town first: It kicks off in Cape Town this year on May 24th and then moves to Johannesburg after that on may 26th!
  • Johannesburg new venue: We are at Gallagher Estate this year! Very excited about the venue!
  • No Durban Sad smile 
  • Hash tag from day one! See complaining to Cliff on Twitter does work so now we can all hash with #DevDaysSA!
  • No SharePoint – I can’t remember a DevDays without SharePoint, but we have so many other awesome SharePoint options now (Information Worker, SharePoint Saturdays etc…) it is good to have some balance.

There is three tracks so you may want to brush up on how to pick good sessions (short answer, mine Winking smile) plus their is special slots for student & community sessions which really excites me to see new presenters getting big stage time!

I am also very glad that BBD Software (previously known as BB&D) is a major sponsor this year!

You can signup, get more details and engage on the official site at: http://www.microsoft.com/southafrica/devdays/

Agenda:

  • End-to-end software testing with Team Foundation Server and Visual Studio
    • Level: 200
      Speakers: Ahmed Salijee & Colin Dembovsky
      Visual Studio 2010 offers a wide range of software testing capabilities: manual testing, automated UI testing, database testing, low-level unit testing and even performance testing tools capable of simulating thousands of active users. It also provides support for test case management, defect tracking as well as configuring and running your tests in virtual and physical environments. But how do you know which tools to choose for your project? This session will, via a demo scenario, walk you through the various testing capabilities to assist you with the most effective use of Visual Studio 2010's testing capabilities. This session will be useful to developers as well as various tester roles including functional, performance and automation.
  • An end-to-end experience of Windows Phone 7 development
    • Level: 200
      Speaker: Rudi Grobler
      An end-to-end walk through for developing Windows Phone 7 applications using Silverlight
  • Blend: Wiring it all together
    • Level: 400
      Speaker: Shane Morris
  • A lap around Internet Explorer 9 for web developers
    • Level: 200
      Speaker: Simon Wilkinson
      Internet Explorer 9 adds new support for HTML5, CSS3 and many other new web standards, and this is the place to find out all about them. Not only will we learn about those, but we'll take a dive into the work the engineering team has done to make the browser faster through it's new JavaScript engine, the work they've done to ensure that the same mark-up works across all browsers and how hardware acceleration will make your site run faster, without any changes to your code!
  • Azure: Development from scratch
    • Level: 200
      Speaker: Gareth Jane
      The Windows Azure platform is a flexible cloud-computing platform which allows developers to rapidly create highly scalable software applications. This session will introduce developers to the various services and components of the Windows Azure Platform. We will create a very simple application on this platform, especially focusing on the areas which distinguish development on Azure from traditional application development
  • ASP.NET web development with MVC
    • Level: 400
      Speaker: Brent Samodien
      Join us in this session and discover the new features in ASP.NET MVC3 and what scenarios you can target with it. Learn more about the improved HTML Helpers and the new updates to Controller/Action/Method that make your code cleaner. Also, explore the richer URL routing and URL route mapping. We will also show how you can use alternative View Engines, including Razor.
  • A website's life: From sketch to publishing
    • Level: 200
      Speaker: Simon Wilkinson
      WebMatrix is a new, free, fully featured, easy to install web development tool that helps you build ASP.NET and PHP websites and perform validation, SEO optimization and one-click publishing. My favourite feature however is a new script syntax for ASP.NET called Razor, which will help you create dynamic websites incredibly easily. We will spend some time sketching/wireframing our website, doing visual design work in Expression Design and then experiencing the rich development toolset in WebMatrix.
  • Let's get ready for the cloud: Building your applications so they
    are cloud ready
    • Level: 400
      Speaker: Robert MacLean
      In a world where you hear people talking about the cloud, here are some guidelines on how to start building and structuring applications that will be easy to migrate to the Azure platform.
  • Code First in entity framework
    • Level: 200
      Speaker: Brent Samodien
      Code First has been a great success with customers, and in this talk, we'll take a deep dive into how it works and talk about its upcoming RTM (Q1 2011). You'll see how Code First uses convention over configuration to improve developer productivity. Its flexibility allows for either automatic database provisioning or the ability to work with an existing database. We'll be demoing features beyond the initial RTM, such as Migrations support, and we'll also talk about the roadmap for Code First going forward
  • Silverlight 5: The Future
    • Level: 200
      Speaker: Shane Morris
  • Exploring Windows Azure storage
    • Level: 400
      Speaker: Gary Hope
      Examine each of the foundation storage capabilities of Windows Azure, Blobs, Tables and Queues. Discover how to create storage accounts; upload and retrieve blobs and blob metadata; create, update and query tables; and create a simple service that uses a message queue for communication
  • LightSwitch basics: Building your first LightSwitch application
    • Level: 200
      Speaker: Robert MacLean
      Visual Studio LightSwitch is the simplest way to build business applications for the desktop and cloud. LightSwitch simplifies the development process by letting you concentrate on the business logic, while LightSwitch handles the common tasks for you. In this demo-heavy session, you will see, end to end, how to build and deploy a data-centric business application using LightSwitch. After that you will discover what is under the hood to better understand the architecture of a LightSwitch application. Finally you will learn how you can use Visual Studio 2010 Professional and Expression Blend 4 to customize and extend its UI and Data layers for when the application's requirements grow beyond what is supported by default
  • Kung Fu Silverlight: Tips and architectural patterns and practices
    • Level: 400
      Speaker: Dave Russell
      Learn about the rewards of using RIA Services together with development patterns, such as the Service Providers, Single Responsibility pattern, Commanding, user Interactions, Messaging, ChildWindows, Design Time Data, Testing, and developing using Model-View/View- Model (MVVM) pattern, to build Silverlight and Windows Phone apps. Hear the top tips you need to know for building data driven Silverlight apps that solve real world problems.
12 Jan 2011

Finally an AWESOME competition for South African Developers

logoI often find too many competitions from Microsoft ignore the southern tip of Africa or focus on specific markets, like education with the great ImagineCup event. Finally us hard working developers get a great competition: Internet Explorer 9 Top Developer Competition

This competition wants* developers to either create an awesome IE 9 add-on or light up a web site with some of the new awesome IE 9 features – so if you a web dev, html monkey, C++ or .NET developer you can take part!

The prize? A trip to PDC – the conference were two years ago everyone got hand build super laptops and last year Windows Phone 7 devices**, not to mention it is where the top Microsoft development speakers meet!

So get coding, you only have until March!!

Some things you may want to check out:

* Side note: “The competition wants” really sounds like the competition is a living entity and will punish you if you don’t do this… it isn’t and it won’t.

** My guess for this year at PDC is giving everyone tablets - just looking at what was announced at CES.

07 Oct 2010

Internet Explorer 9 breaks with localhost

There is a known bug for this 601047 This is resolved with RTM!
You can hear Eric Lawrence talk about this bug in the Herding Code Podcast

Internet Explorer 9 works great, except when it doesn’t, and it seems to not work for developers more than most, or maybe it’s just me (could the IE9 team be targeting me?).

Paranoia aside, there is an issue where when testing web applications (ASP.NET, MVC) or Silverlight applications from Visual Studio (i.e. press F5) it just refuses to load. Thankfully this has been confirmed by other people Winking smile

image

What is going on and how do we solve this? Because it is really frustrating and it also makes for bad demos (especially with TechEd around the corner).

The first part of the problem is the ASP.NET Development Server which is what is hosting your websites when you hit F5.

image

Next part of the problem is Windows, especially since it assumes IPv6 is better than IPv4. Note in the picture below that when you ping localhost you get an IPv6 address.

image

So what appears to be happening is when IE9 tries to go to localhost it uses IPv6, and the ASP.NET Development Server is IPv4 only and so nothing loads and we get the error.

To solve this fire up notepad in administrator mode and navigate to <windows directory>\system32\drivers\etc\ and open the hosts file. Inside you will find a number of lines prefixed with a hash (which makes those lines comments). Remove the hash from the line which has 127.0.0.1 in it, as below and save.

image 

This will cause Windows to resolve localhost to IPv4 first (you can confirm by pinging localhost) which means that IE9 will do the same and now it just works every time.

image

06 Oct 2010

Redirected down a one way: Clearing the Internet Explorer host redirect cache

Internet Explorer 9 is fast, really, really fast! A lot of that speed comes from the massive caching improvements in IE9 – but this is a bit of a double edge sword, especially for developers when caching gets in the way of what is actually happening. I spent two hours debugging an odd caching issue recently and this is the sad story.

For some testing I needed to setup a redirect, in this case a 301 permanent redirect (handy HTTP status codes cheat sheet in case you don’t remember these). What this would do is enable me to have site alpha (http://localhost:5000/Demo) redirect to site beta (http://localhost:9000/Demo).

Prior to this the scenario look like this:

image

Behind the two browser windows is the IE 9 Developer tools and their fantastic new network capture feature. You can easily see that when I hit site alpha I got a 200 result, meaning all good and it loaded.

Once I setup the redirect, you’ll see I get a 304 this is because the data is already cached. Note that even though I typed in the site one URL it immediately loaded site two. This is because the browser had cached the redirect and so skipped the network steps for performance.

image

Now the problem, I wanted to turn off the redirect – however the browser cached it and so would ignore the change. Clearing cache, deleting files, rebooting and even using the IE reset option did nothing to solve this Crying face 

The only way to fix it was to fire up the fantastic Fiddler tool and use it’s Clear Cache option with the option to delete persistent cookies, which flushes the WinINET cache.

image

Considering that this is supposedly the same as clearing the IE cache I have no idea why this works and IE cache clearing doesn’t but it does work.

27 Sep 2010

Cannot add a Service Reference to SharePoint 2010 OData!

SharePoint 2010 has a number of API’s (an API is a way we communicate with SharePoint), some we have had for a while like the web services but one is new – OData. What is OData?

The Open Data Protocol (OData) is a Webprotocol for querying and updating data that provides a way tounlock your data and free it from silos that exist in applicationstoday. OData does this by applying and building upon Webtechnologies such as HTTP, Atom PublishingProtocol (AtomPub) and JSON toprovide access to information from a variety of applications,services, and stores.

The main reason I like OData over the web services is that it is lightweight, works well in Visual Studio and works easily across platform, thanks to all the SDK’s.

Clipboard01SharePoint 2010 exposes these on the following URL http(s)://<site>/_vti_bin/listdata.svc and you can add this to Visual Studio to consume using the exact same as a web service to SharePoint, right click on the project and select Add Service Reference.

Once loaded, each list is a contract and listed on the left and to add it to code, you just hit OK and start using it.

Add Service Reference Failed

Clipboard03The procedure above works well, until it doesn’t and oddly enough my current work found a situation which one which caused the add reference to fail! The experience isn’t great when it does fail – the Add dialog closes and pops back up blank! Try it again and it disappears again but stays away.

Clipboard04If you check the status bar in VS, you will see the error message indicating it has failed – but by this point you may see the service reference is listed there but no code works, because the adding failed.

If you right click and say delete, it will also refuse to delete because the adding failed. The only way to get rid of it is to close Visual Studio, go to the service reference folder (<Solution Folder>\<Project Folder>\Service References) and delete the folder in there which matches the name of your service. You will now be able to launch Visual Studio again, and will be able to delete the service reference.

What went wrong?

Clipboard06Since we have no way to know what went wrong, we need to get a lot more low level. We start off by launching a web browser and going to the meta data URL for the service: http(s)://<site>/_vti_bin/listdata.svc/$metadata

In Internet Explorer 9 this just gives a useless blank page Sad smile but if you use the right click menu option in IE 9, View Source, it will show you the XML in notepad. This XML is what Visual Studio is taking, trying to parse and failing on. For us to diagnose the cause we need to work with this XML, so save it to your machine and save it with a .csdl file extension. We need this special extension for the next tool we will use which refuses to work with files without it.

Clipboard07The next step is to open the Visual Studio Command Prompt and navigate to where you saved the CSDL file. We will use a command line tool called DataSvcUtil.exe. This may be familiar to WCF people who know SvcUtil.exe which is very similar, but this one is specifically for OData services. All it does is take the CSDL file and produce a code contract from it, the syntax is very easy: datasvcutil.exe /out:<file.cs> /in:<file.csdl>

Immediately you will see a mass of red, and you know that red means error. In my case I have a list called 1 History which in the OData service is known by it’s gangster name _1History. This problem child is breaking my ability to generate code, which you can figure out by reading the errors. 

Solving the problem!

Clipboard09Thankfully I do not need 1 History, so to fix this issue I need to clean up the CSDL file of _1History references. I switched to Visual Studio and loaded the CSDL file in it and begin to start removing all references to the troublemaker. I also needed to remove the item contract for the list which is __1HistoryItem. I start off by removing the item contract EntityType which is highlighted in the image along side.

The next cleanup step is to remove all the associations to __1HistoryItem.

Clipboard10Finally the last item I need to remove is the EntitySet for the list:

BREATH! RELAX!

Ok, now the hard work is done and so I jump back to the command prompt and re-run the DataSvcUtil tool, and it now works: Clipboard12

Clipboard14This produces a file, in my case sharepoint.cs, which I am able to add that to my project just as any other class file and I am able to make use of OData in my solution just like it is supposed to work!

24 Nov 2008

IE 8 Beta 2 - Zoom issues

If you are using IE 8 beta 2 and your zoom is NOT at 100% you could be having all kinds of issues from performance to skipping around the screen and being unable to select text. This doesn’t seem to be a big issue, I mean who runs at anything other than 100% but it is bigger than that. See in IE 8 your DPI settings will effect the zoom, so if you are running 1280x1024 or higher by default you will be at 120DPI and not the standard 96DPI which means you will run at 125% zoom in IE! It also effect people using the zoom for accessibility reasons.

There are two items available for voting on for these issues on Connect, so if you are an IE 8 beta user please take the 5 min to first test yourself and if you are able to repro the issue please vote on these items:

24 Nov 2008

GMail - Oh so sexy

If you haven’t checked out GMail for a while, you need to today! They have launched approx 12 themes for it. That in itself isn’t impressive but the fact the themes seem MUCH faster than before and work perfectly in IE 8 Beta 2 in standards mode means that is one less site that I have to keep IE in compat mode for!

gmail2

My inbox with the new Shiny theme – after Firefly anything names Shiny gets bonus points with me.

Pages