Skip to main content

SharePint @ Tech·Ed 2010!

After a full day of learning new and interesting SharePoint tips, tricks and ideas, come and hang out with fellow SharePoint enthusiasts to help digest your new knowledge and a pint or two of anything else you like.
Hosted by The MOSS Show, with with some prizes to give away, it should be a fun evening for all.
RSVP essential as we need to finalise venue bookings!
Date: Monday, 18 Oct.
Venue: Cubana Durban, 128 Florida Road
Time: 7:00 p.m.
Dress: Collared shirts & smart shoes for gents
Map & Directions from the CCI: View Map
Click to Register Here
A special thanks to our Sponsors:
Sponsors

Tech·Ed Africa 2010 Twitter List

Looking for Tech·Ed Africa 2010 speakers and key accounts, like Xbox South Africa, on Twitter? The solution a Twitter list I create where you can find everyone in one place to follow individually or you can just follow the whole list.

List: @rmaclean/teched-africa

Being a list it is not filtered on hash tags and so on, which means you will likely get off topic discussion too.

image

If I am missing anyone, please let me know via the site or Twitter.

Tech·Ed Africa 2010 Calendar is AWESOME!

imageIf you have registered for Tech·Ed Africa 2010, there is a feature that you just have to use – the calendar. I know calendars sound boring but this one is not! To use it login to your Tech·Ed Africa 2010 account (My Tech·Ed –> Login) image then click on Calendar –> My Event Calendar and you can click on each time slot and scroll through a list of content available at that timeslot.

This has the benefit of helping focus you down to what is available and getting that planning out of the way but you may miss the BEST features it it. Once you have completed your planning you can use the small iCal and printer buttons at the top: image

Print does exactly what you think – a clean print view: image

But the iCal is FANTASTIC – it provides you a file to bring into Outlook which lists all your sessions in your calendar so you can easily sync to your device – but more than that ALL the details is listed in the body of the invites so when you arrive at the event you can quickly recall what the session is about!

image

image

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

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.

Have you got the right stuff?

1145_devidols_small_thumb_7C5198E0Tech·Ed Africa is a few weeks away and Microsoft have announced an amazing event which will run at the event – Dev Idol!

It is really easy, you go to Tech·Ed and at a specified time you get up and present a short  presentation of your choosing – and if it is the best you win, and you win BIG!

The prize for the winner is a speaker slot at Tech·Ed Africa 2011 (this is a big deal trust me) and an XBox 360! Two runner ups get free entry to Tech·Ed Africa 2011.

Before you throw your hands up and say, “What’s the point?! Tech·Ed Africa 2010 already has great presenters who will easily win it!”, well current presenters are not allowed to enter, this is only open to attendees! However you have to hurry as you only have until the 13th October to get your entries in.

Get all the details you will need at http://blogs.msdn.com/b/southafrica/archive/2010/09/29/dev-idol-comes-to-tech-183-ed.aspx

Tech·Ed Africa - How to find the gems in the sessions?

image_54Tech·Ed is around the corner and if you have seen the session catalogue, you will see there is 267 295 sessions available for you to attend! How are you supposed to know what sessions are quality that you should attend?

Disclaimer: Rights Management Server is a great product for certain situations and I am picking on it in this post as an example more than anything else.

Know Yourself

The first thing to get right is to know yourself – if you have just started writing C# code, attending an advanced session on the internal workings of LINQ may be a waste of time as you may not be able to keep up to speed.

Knowing yourself is not just about knowing your skill level, but also knowing what is important to you – if you have no plans on using Rights Management Server (RMS) don’t attend the sessions on it, because you will miss out on other great sessions that may bring you a value, however this does not mean you should only attend sessions for technology you know and work on.

Identify Trends

channel-9-logoPart of the benefit of the conference is exposure to items which you may not get the time to see during your normal day, so you may be tempted to go to that RMS session because you do not know about it but my suggestion to this is that  when you are looking for sessions on topics you do not know about, you should look at where the hot trends are (they aren’t in RMS). A great way to see what the hot trends are is to to look at what community and knowledge sharing sites, like Channel 9, is talking about.

The reason I suggest new trends over other items is this that the new trends is where the cutting edge technology and learning is and so there is often not a lot of content available on that topic, compared to say RMS where it is well documented and training is easy to get hold of.

Decoding Sessions

Every session at Tech·Ed has a code, and this code has some key information that will mean you get to the right sessions easily. If I look at one of the sessions I am presenting, the code associated is APS309, but what does that mean?

  • APS – This is the track, or the high level concept that the session is part of. APS in this case refers to Application Server. Microsoft has a great guide to all these TLA (three letter acronyms) on the technical track page. The only item missing from there is WTB, which stands for Whiteboard which I will cover next.
  • 3 – This digit is key, it identifies the level of the session and is between 1 and 4.
    • 1 indicates a introduction session - where you can come in with zero knowledge on the topic. Expect it not to be deep, expect the pace to be slow and expect it to cover the concepts.
    • 2 indicates a beginner session - you should’ve seen something on it before arriving. Expect it to cover usage scenarios and the pace and depth to be increased.
    • 3 indicates a technical session – you should be working with the technology. These often go fast and deep or explore a new area in that space.
    • 4 indicates a deep dive – you should expect a session that is for the most advanced of people.
  • 09 – This is a unique identifier.

The next thing about understanding is to read the abstract for the topic, this is the overall plan for the session. So if we take my session again, the title is: Intro to Workflow Services and Windows Server AppFabric however if you read the abstract you will note that it mentions Workflow Foundation (WF) first and talks about developers using it. Then it mentions WF and usage with Windows Communication Foundation (WCF) and how they integrate in .NET 4. Finally it mentions AppFabric and hosting.

This tells you a lot of my plan for the session, I am going to talk to developers first about WF and then WCF. Finally I will bring in more technical topic of hosting these in AppFabric. This does not come across in the title, which is why the abstract is important to read and read carefully.

Session Types

There are two types of sessions breakouts and whiteboards. A breakout is a formal presentation where normally one person presents a topic with demo’s. A whiteboard is far less formal and often includes panel discussions – here you will find the topics often change based on the questions and discussions with the audience.

I have personally found when I need to learn a technology I head to a break out, but if I know the topic then the whiteboards give senior developers much better value.

Networking

Tech·Ed is first about getting a few thousand passionate people together which means you have the option to network with experts and make great contacts. Most presenters will take time for questions, but if not, most will welcome you coming up to them afterwards.

In addition to this there is also two special options for networking:

  • Community Lounge – Community leaders are some of the smarted and most passionate people I know and the community lounge provides a great place to relax and talk to them.
  • Ask the Experts – This is a special event where experts make themselves specially available to take questions and have one on one (and sometimes one on many) discussions. This is a great chance to get contacts so that when you run into a problem you have a lifeline.

Get Started Now

Don’t wait until you arrive at Tech·Ed to start thinking about sessions, start thinking now about the sessions you want to go to and digging into what trends and speakers you should be finding.

A great tip for corporates is something we at BBD do each year for the 30 or so people we send – a pre event get together. Here the people who have been before share some guidance and what to expect about the event with those who have never been and we all talk about the sessions and speakers we are excited about to help those who do not have the time to do deep research find some gems.

Lastly, for those who tweet, start following the Twitter conversation for the event! There is an official account @teched_africa and an officially long hashtag #TechEdAfrica. To really impress people you can combine them both into a single Twitter Search @TechEdAfrica OR #TechEdAfrica!

Update 8 Oct 2010: I presented a short session based on this post to the staff at BB&D which you can find below:

Upload files to SharePoint using OData!

I posted yesterday about some pain I felt when working with SharePoint and the OData API, to balance the story this post cover some pleasure of working with it – that being uploading a file to document library using OData!

This is really easy to do, once you know how – but it’s the learning curve of Everest here which makes this really hard to get right, as you have both OData specialisations and SharePoint quirks to contend with. The requirements before we start is we need a file (as a stream), we need to know it’s filename, we need it’s content type and we need to know where it will go.

For this post I am posting to a document library called Demo (which is why OData generated the name of DemoItem) and the item is a text file called Lorem ipsum.txt. I know it is a text file, which means I also know it’s Content Type is plain/text.

The code, below, is really simple and here are what is going on:

  • Line 1: I am opening the file using the System.IO.File class, this gives me the stream I need.
  • Line 3: To communicate with the OData service I use the DataContext class which was generated when I added the service reference to the OData service and passed in the URI to the OData service.
  • Line 8: Here I create a DemoItem - remember in SharePoint everything is a list or a list item, even a document which means I need to create the item first. I set the properties of the item over the next few lines. It is vital you set these and set them correctly or it will fail.
  • Line 16: I add the item to the context, this means that it is being tracked now locally – it is not in SharePoint yet. It is vital that this be done prior to you associating the stream.
  • Line 18: I associate the stream of the file to the item. Once again, this is still only happening locally – SharePoint has not been touched yet.
  • Line 20: SaveChanges handles the actual writing to SharePoint.
using (FileStream file = File.Open(@"C:\Users\Robert MacLean\Documents\Lorem ipsum.txt", FileMode.Open))
{
    DataContext sharePoint = new DataContext(new Uri("http://<sharepoint>/sites/ATC/_vti_bin/listdata.svc"));                

    string path = "/sites/ATC/Demo/Lorem ipsum.txt";
    string contentType = "plain/text";
    DemoItem documentItem = new DemoItem()
    {
        ContentType = contentType,
        Name = "Lorem ipsum",
        Path = path,
        Title = "Lorem ipsum"
    };

    sharePoint.AddToDemo(documentItem);

    sharePoint.SetSaveStream(documentItem, file, false, contentType, path);

    sharePoint.SaveChanges();
}

Path Property

The path property which is set on the item (line 12) and when I associate the stream (line 18, final parameter) is vital. This must be the path to where the file will exist on the server. This is the relative path to the file regardless of what SharePoint site you are in for example:

  • Path: /Documents/demo.txt
    • Server: http://sharepoint1
    • Site: /
    • Document Library: Documents
    • Filename: demo.txt
  • Path: /hrDept/CVs/abc.docx
    • Server: http://sharepoint1
    • Site: /hrDept
    • Document Library: CVs
    • Filename: abc.docx

Wrap-up

I still think you need to still look at WebDav as a viable way to handle documents that do not have metadata requirements, but if you have metadata requirements this is a great alternative to the standard web services.

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!

Come and hang out with me at Tech·Ed Africa 2010!

imageTech·Ed Africa 2010 is less than a month away and it is a massive conference where all things IT Pro and developer are discussed. It is a great conference, filled with networking (read: beer), wonderful sessions and great prizes!

I will be attending as a speaker again this year so I thought I would share what I will be talking about, however before I get to that I want to talk about a wonderful prize I am giving away.

Certain MVP’s got given some Visual Studio 2010 Ultimate licenses to give away, and I was lucky enough to get three of those. Each license is values at $11600!! I will be giving these away at the community lounge as part of a fun game! Details of the game will be available at the lounge at the event.

Back to my shameless promotion Winking smile Tech·Ed has two types of sessions Breakout Sessions where I get up on stage and present and demo for about an hour and Whiteboard Sessions which are interactive discussion sessions. I am lucky to have a few of each. Note: this is all subject to change.

Breakout Sessions

Intro to Workflow Services and Windows Server AppFabric

Windows Workflow Foundation 4 (WF4) provides a flexible, declarative programming model and a brand new runtime architecture that makes it easily accessible for .NET developers. What that means for developers is that WF4 can make it easier to put together your application logic, encapsulate complex control flow logic, and abstract complex programming tasks. WF4 also composes nicely with Windows Communication Foundation (WCF) for writing declarative workflow services that support content-based message correlation and long-running duplex conversations. When you combine the framework features with the new AppFabric capabilities in Windows Server to host and manage your workflows and services , you have a comprehensive workflow solution in Windows. In this session we will look at examples of how you can use WF4 in your application and service development to speed your development and simplify complex tasks, as well as how to build powerful, manageable workflow services with WF, WCF and AppFabric. Come find out how this powerful, testable framework can help you and your development team take programming to the next level.

WCF Made Easy with Microsoft .NET Framework 4 and Windows Server AppFabric

Windows Communication Foundation (WCF) is a flexible and powerful platform for building service-oriented applications, and with that flexibility comes some complexity. As of .NET Framework 4 – configuring, securing, hosting and managing WCF services has never been easier! WCF 4 and Windows Server AppFabric come together to help developers and IT administrators overcome the complexity. Come find out how much easier it is to configure WCF services in .NET 4 including alignment with the Microsoft ASP.NET configuration model and a reduced configuration footprint. Also learn Windows Server AppFabric features for the IT administrator, finally making it easier for IT administrators to easily access settings they care about such as security and throttling features; providing control over the hosting lifecycle of WCF services; and giving new visibility into faults, exceptions, and tracing and diagnostics features to help you manage your service deployments in production un-intrusively.

Windows Server AppFabric Caching: What It Is and When You Should Use It

The distributed in-memory caching capabilities of Windows Server AppFabric will change how you think about scaling your Microsoft .NET-connected applications. Come learn how the distributed nature of the cache allows large amounts of data to be stored in-memory for extremely fast access, how AppFabric’s integration with Microsoft ASP.NET makes it easy to add low-latency data caching across the Web farm, and discover the unique high availability features of AppFabric which will bring new degrees of scale to your data tier.

Whiteboard Sessions

Web Service Interop

This is a panel discussion on web service interop with myself, Nabeel Prior (Microsoft BizTalk Expert), Anton Delsink and Ryan Crawcour (BizTalk Expert from New Zealand).

Powering Rich Internet Applications: Windows Server AppFabric, Web Services, and Microsoft Silverlight

This is a panel discussion on with myself, Ryan Crawcour (BizTalk Expert from New Zealand) and Rudi Grobler (WPF MVP).