Posted by Keith Elder | Posted in .Net, Speaking, WCF | Posted on 19-03-2011
Next weekend you will find me even further South than I normally am as I’ll be speaking at the Orlando Code Camp. A huge thank you goes out to one of the best places to work in the country and that is Quicken Loans (my employer) that not only allowed me to take a day off to get to Orlando but also helped out with the travel. Not only does Quicken Loans hold the current the highest nationwide ranking in mortgage origination satisfaction but the company understands community and wants to help give back where it can.
While in Orlando I’ll be doing two talks. One is a Back to the Basics talk that I was very happy that got chosen because honestly we do not have enough of these at code camps. This is the exact same session I’ve done at larger conferences such as TechEd and Codemash. Thus if you have any team members that don’t know .NET send them here! Here is the abstract:
No other name in history has confused more people on the planet than when Microsoft named their development platform .NET. For a lot of developers .NET remains a mystery and it is often confused with many things. The Back to the Basics series is a primer for anyone that is starting at ground zero with .Net. In this session we’ll look at what .Net really is, the benefits of the platform, bust a few myths and show some sound reasons why you should consider it as a platform. At the end of the session, hopefully we’ll answer one of life’s most puzzling questions: What is .NET?
The second talk I’ll be doing is on Windows Communication Foundation entitled “Demystifying Windows Communication Foundation 4.0”. There really is a lot of good stuff in WCF that simplifies a lot of things that really needs some light shed on it and I’m here to do just that. Why is WCF so important? Well put it this way, let me turn off services from the Internet and let’s just see how smart your Smartphone of choice is then. Services are the backbone of mobile apps and smart clients and it is important to know how to build them quickly and efficiently. Here is the abstract:
Windows Communication Foundation (WCF) has gone through two major releases and is now ready for prime time but may enterprise developers are still holding onto ASMX web services. In this session we are going to learn why moving to WCF is a good thing and much easier in .NET 4.0. We’ll also look at many new features in WCF 4.0 such as simplified configuration along with multiple site bindings introduced with the latest release of .NET 4.0.
I’ll have some Deep Fried Bytes stickers with me in Orlando so if you want one that’ll be the time to acquire one.
I’ve already packed my gator gun, mosquito spray, flippy floppies and bright colored shirts. See you in Orlando!
Posted by Keith Elder | Posted in Presentations, Speaking, WCF | Posted on 07-09-2010
TechEd 2010 was in New Orleans last week and I had the pleasure of doing a full day pre-conf session at TechEd. Pre-confs are longer sessions where attendees can get into more details. This year I did “.NET From Scratch” which was a one day session to introduce developers to the .NET platform.
This seminar is for anyone who is starting at ground zero with .NET and wants a deep dive into the platform starting from scratch. It is designed for developers experienced in at least one other language, and starts with the basics of . NET and covers Microsoft Visual Studio, writing code in C#, and how to build applications in various technologies of the platform such as Windows, Web, Microsoft Silverlight, and Windows Mobile. If you are new to writing applications on Microsoft .NET, what better way to start your Tech·Ed experience?
As promised to the attendees, the slide decks and demos can be downloaded from the following URL:
Remember when learning a new platform as large as .NET the main thing to focus on are your immediate needs. That may be a language and a framework and possibly web programming. It is impossible to learn or know everything about a platform as large as .NET but knowing what is possible is half of the battle. As engineers if we know it is possible it is just a matter of research to figure out how to make it happen.
A big thank you to those that attended the session and I am truly sorry about how cold it was in the room. If I’d known in advance I’d brought some firewood and blankets. Enjoy.
Posted by Keith Elder | Posted in .Net, C#, WCF | Posted on 09-03-2010
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
3: public class WcfDataService1 : DataService<NutshellEntities>
5: // This method is called only once to initialize service-wide policies.
6: public static void InitializeService(DataServiceConfiguration config)
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);
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:
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:
Yep, it was suppose to be “Customers” instead of “Customer”. Change line 13 to “Customers” and all is well.
Posted by Keith Elder | Posted in WCF | Posted on 08-03-2010
I just created a brand new solution in Visual Studio 2010 Release Candidate playing around with some new ideas on WCF Data Services. I launched the solution to test my service and I was greeted with this lovely error:
The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as ‘Allowed’ or ‘Required’.
This is a pretty easy fix but I thought I’d blog it anyway. There are two options as the error points out. Add an attribute or change the config file. Here’s what you need to add if you want to go the attribute route:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
If you want to go the web.config route instead then change the serviceHostingEnvironment element as follows.
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
Hope this helps.