Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

WCF Data Service Error – Request Error

Posted by Keith Elder | Posted in .Net, C#, WCF | Posted on 09-03-2010

3

I’ve done this twice now and I know if I’ve done it others probably have as well.  Here’s the short story and the fix.

Let’s say you create a new project to play around with a WCF Data Service to create some OData.  You add an entity framework model from an existing database and then add a WCF Data Service.  Things are going along nicely.  To get something up and running quickly you modify the WCF Data Service to look like the following.  All looks good.

   1: namespace WcfService2

   2: {

   3:     public class WcfDataService1 : DataService<NutshellEntities>

   4:     {

   5:         // This method is called only once to initialize service-wide policies.

   6:         public static void InitializeService(DataServiceConfiguration config)

   7:         {

   8:             // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.

   9:             // Examples:

  10:             // config.SetEntitySetAccessRule("MyEntityset", EntitySetRights.AllRead);

  11:             // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);

  12:             config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;

  13:             config.SetEntitySetAccessRule("Customer", EntitySetRights.All);

  14:         }

  15:     }

  16: }

Then you build your solution thinking you are about to strike gold when all of a sudden you are presented with this nasty unhelpful error:

image

Request Error

The server encountered an error processing the request. See server logs for more details.

The problem lies in line 13.  See the string?  Yeah, that’s a spot where we as humans have to type something and let’s face it, we make mistakes.  I’ve done this several times already.  To fix this, look at your model and make sure you have the correct name.  Here is my playground model:

image

Yep, it was suppose to be “Customers” instead of “Customer”. Change line 13 to “Customers” and all is well.

Software Engineering 101 Today via Live Meeting!

Posted by Keith Elder | Posted in .Net | Posted on 27-02-2010

0

Today is the key word, if you are reading this on Sunday or at a later date, sorry.

The Software Engineering 101 workshop is going on today.  Here is how to join RIGHT NOW.  That’s right, it is going on RIGHT NOW.

First thing is you need to have Live Meeting installed.  You can get Live Meeting here:

http://office.microsoft.com/en-us/downloads/CD102447411033.aspx?ofcresset=1You’ll

After the client is installed go to this URL:

http://www.livemeeting.com/cc/microsoft

After the site opens up, click this link:

image

When the link is clicked this window will open:

image

Enter the following Meeting ID and Entry Code:

MEETING ID =W3FQMB
ENTRY CODE=65?4mKN3D

After you get the client up BE SURE that your microphone is muted, it should be red.

image

Also follow along using the Twitter hashtag #swe101

Codemash 2010 Slides – .NET Basics

Posted by Keith Elder | Posted in .Net, MVP10 | Posted on 27-02-2010

0

I committed a major faux pas as far as speakers go.  I woke up this morning and realized I had never published my slide decks for the full day Precompiler I did at Codemash 2010 on Back to The Bascis with .NET.  To correct this travesty I immediately grabbed the folder, compressed it and uploaded it to my site for the world to enjoy (or print copies of and burn, either way).  You can find all five decks along with some of the demos at the following URL:

http://keithelder.net/Presentations/BackToBasics/Codmash2010-BackToBasics.zip

Abstract: This all-day session is targeted to anyone new to .NET. You’ll start out with basic “What is .NET?” and move through building applications on in various .NET technologies. Topics covered include:

  • What is .NET? Discusses the fundamentals of the .NET platform, what it is, where it can be used, and a few myths about .NET.
  • How to Use Your Hammer – Visual Studio Walks you through how to use Visual Studio features like Intellisense, Source Control integration, debugging, and other critical foundational skills.
  • A Programmer’s Primer Programming in C# Covers the basics of the C# language from Object Oriented Programming principles all the way to generics, collections, and LINQ. This is a programmer’s primer, which means you should already know at least one language and have some experience programming.
  • Client Applications Covers standard Windows applications, Windows mobile applications and newer Windows applications based on Windows Presentation Foundation (WPF).
  • Web ApplicationsCovers the variety of ways to build web-based applications in .NET. standard ASP.NET, ASP.NET MVC, Silverlight and Web Services.

Dear Microsoft: Please Simplify Your Platform for Developers

Posted by Keith Elder | Posted in .Net, MVP10 | Posted on 09-01-2010

8

I’ve been preparing a new laptop for the majority of the weekend that I am planning on using at Codemash 2.0.1.0 to teach a full day seminar.  It has blown my mind at the amount of software, and patches and service packs I have had to install in order to setup a new development environment to mainly get the http://www.dinnernow.net demo to work.  We have to find a better way!

Hopefully someone at Microsoft is listening and reading this.  If you work for Microsoft, please pass this plea of help along. 

My Problem

Let’s look at the problem real quick.  As a .NET developer we all understand that we have to install Visual Studio.  So we do.  Then there is always a service pack, or a service pack to the .NET framework (depending on when you are installing during the life cycle).  Then we need to install SQL Server, and then a few service packs for it, and then we need to install the ASP.NET MVC kit, then the Silverlight kit (which has a few dependencies) and then we have to install…. well you get the idea.  It is a never ending install of one thing and another.

Having a lot of friends that work at Microsoft and knowing how things work internally a bit, I know that different teams are responsible for various pieces of the .NET developer ecosystem.  I also understand that what I am about to ask is not going to be trivial to build but I think it is a must because of how large and vast the .NET platform is these days.  And of course it is about to get bigger when Windows Mobile 7 launches and comes out. 

What I Want

I want my cake and to eat it too.  Of course. But seriously, here is what I want.  I want a *tool* or something baked into Visual Studio whereby I can install different things with a single click.  Hmm, I’ve seen this somewhere before, oh yeah, the “Microsoft Web Platform Installer”.  Here let me give you a clearer picture:

image

This tool, targeted at web developers only, is a start in the right direction, but the problem is the scope is too narrow.  It needs to encompass the WHOLE platform.  Personally I think this tool should be expanded to allow me to easily find any and everything I as a developer could possibly want to install.  This may be CTP of MVC 2, a new release of Silverlight, or a new mobile SDK, or a Dublin or Oslo preview.  Whatever it is it doesn’t matter, I should have a ONE stop shop whereby I can grab whatever I want. Oh, and it should interface with my MSDN account too in case there is something I need that I can only get off of MSDN. 

Here’s a question: Why do I have to do a web search to find what I am looking for?  Why do I have to figure out all of the dependencies by reading multiple web pages and so on.  Every time I have to do a search for something that I need an angel looses their wings.  Please help us keep the wings on the angels. 

I understand this would require the left hand knowing what the right hand is doing but we as .NET developers need a simpler way of finding what we need and installing it than what we have today.  Not to mention the fact that it boggles the mind of those to no end trying to learn .NET.  I know this can be better.  It just takes focus and prioritization. 

You know what, even thinking about it more, 3rd party vendors would LOVE this tool if they could plug their stuff into it.  And I, as a developer would LOVE to be able to install my favorite add ins without a fuss.  This could be huge.

So there you have it, what do you say? Or maybe someone out here on the Internets has even a better idea.  Like for example, maybe create PowerShell scripts that help us (similar to apt-get on Debian Linux).  I personally don’t care how you do it, you have smart people there that can figure it out, I’m just the messenger telling you there is an opportunity here.

Thanks for listening,

 

Keith “is this thing on?” Elder

Speaking at TechEd 2010 in New Orleans – .Net From Scratch

Posted by Keith Elder | Posted in .Net, MVP10, Speaking, TechEd | Posted on 08-01-2010

5

clip_image001

I’ve been wanting to post this for a few days now but wanted to wait until I got the *official* email.  This morning it finally came so I can break the news that I’ll be doing a full day pre-conference session at TechEd 2010 in New Orleans, LA.

The conference is officially slated for June 7-10th this year but as typical with most conferences like this there is a pre-conference that happens the day before the conference.  The pre-conference sessions are typically full day lengthy sessions whereby attendees can get deeper into a technology.  This year I will be doing a pre-conference entitled “.Net From Scratch” (at least I think that is going to be the title). 

.Net from scratch will start attendees at the beginning of what .Net is and work through all the layers of the platform building upon one another.  Some of you may recall my “Back to the Basics” series and this is born right out of that.  I know there are attendees that go to these larger events where some get their first exposure to the .Net platform.  There are a multitude of reasons why this is but I’ve never seen any sessions tailored to bringing new people into the platform.  The bottom line is if you don’t have a way to get people introduced the platform, the platform doesn’t grow.  Most of the time speakers like to talk about the new shiny thing, leaving out those people that are just getting started.  Someone has to fill this gap and I am truly passionate about filling this void. 

What is the moral of the story?  If you are going to TechEd 2010 and don’t know .Net but want to learn it come to this pre-conference session. Or if you know someone that is going to TechEd that is trying to learn .Net and the platform tell them about this pre-conference session.  It’ll be a great primer for things they’ll see and learn later in the week.

I was wanting to host a crawfish boil at my house (which is only 1.5 hours from New Orleans) on the Saturday before TechEd this year but I don’t know if I’ll be able to prepare all that I have to prepare for and host a crawfish boil.  We’ll see how things pan out.  If you’d be interested in attending a Pre-TechEd Crawfish Boil in Hattiesburg at my house on Saturday before TechEd let me know (comment, IM or carrier pigeon).  If there is enough interest I’m sure I can make it happen.