Posted by Keith Elder | Posted in Asp.Net, Podcast | Posted on 06-04-2010
In this episode we caught up with the team that wrote the book ASP.NET MVC In Action: Jeffrey Palermo, Ben Scheirman and Jimmy Bogard. The guys discussed the book, what drives their passion around ASP.NET MVC and what is in store for this huge change in ASP.NET development.
Posted by Keith Elder | Posted in Podcast | Posted on 06-04-2010
Silverlight 4 is just around the corner and it is the one technology a lot of developers are waiting on to build the next generation of rich Internet applications. In this episode Keith and Woody caught up with Jesse Liberty at the Professional Developers Conference and discussed what’s coming in Silverlight 4 and what it means for developers.
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
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:
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:
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.
Posted by Keith Elder | Posted in Visual Studio | Posted on 05-03-2010
Several people asked me today what settings I use for Visual Studio after I twittered the following earlier today:
Here’s what my environment looks like. I use a dark theme. I can’t tell you how important this was for me after I had eye surgery. Still is, I can’t stand a lot of glare.
And here is a web.config file view. Very simple color scheme.
If you’d like to try this theme out then download the file below. Within Visual Studio go to Tools->Import and Export Settings to import. The changes will be immediate. Let me know what you think.
UPDATE 3/6/2010
Shawn Wildermuth pointed out that my colors for editing XAML files was horrible. I don’t edit XAML much and when I opened a XAML file it was as if I was viewing a color scheme designed a 2nd grader. He was right. Shawn took my file and updated it and now it is much better. Thanks Shawn!
Thus here is latest version with the XAML fix.
http://keithelder.net/VisualStudioSettings/FontAndColors/DarkElder.zip