.NET

HttpContextBase and Dependency Injection

I was just hunt down by a minor bug in my code and couldn’t figure out what was happening. I’m using Dependency Injection to inject the HttpContextBase into a service call so I can more easily unit test it. So I was setting it up like this: 1: ObjectFactory.Initialize(x => 2: { 3: x.For<HttpContextBase>().Use(new HttpContextWrapper(HttpContext.Current)); 4: ...

posted @ Friday, June 17, 2011 6:13 PM | Feedback (0)

My Windows Phone 7 App failed… Requirement 5.2.4.c

So I submitted my third app, Shapes, into the WP7 Marketplace and 48 hours later I get an email saying it failed. I read the details and it failed because of requirement 5.2.4.c: If the current page displays a context menu or a dialog, the pressing of the Back button must close the menu or dialog and cancel the backward navigation to the previous page. The expected result: Test Process Required: ...

posted @ Thursday, December 16, 2010 9:36 AM | Feedback (0)

Linq To Sql not updating on Context.SubmitChanges()

Tonight I ran into a weird problem that I haven’t seen before. I was getting an entity back from a query, changing some values, and calling the DataContext.SubmitChanges() and the database was not being updated. The code ran fine without any exceptions. Weird! I decided to fire up SQL Server Profiler and see what queries were being executed and to my surprise Linq To Sql (L2S) was not executing anything. After 5 minutes of thinking why that would be the case the light bulb turned on! I didn’t have a Primary Key set on the table. Why I didn’t have...

posted @ Thursday, November 04, 2010 9:58 PM | Feedback (3)

Join me at the 2010 South West Florida CodeCamp (SWFL CC)

This upcoming Saturday, September 25th, I will be presenting “Real World Chat Application Using Push Notification with Windows Phone 7” at the 3rd SWFL Code Camp. The event will be held at the FGCU campus in Estero, FL. See you there!

posted @ Thursday, September 23, 2010 4:20 PM | Feedback (0)

Windows Phone 7 Developer Tools Beta Released

Windows Phone 7 Developer Tools Beta have been released. Tools Download the Windows Phone Developer tools beta to get started creating Windows Phone 7 applications today. This download includes: Visual Studio 2010 Expression For Windows Phone beta; Windows Phone Emulator beta; Silverlight for Windows Phone beta; Expression Blend for Windows beta; and XNA Game Studio 4.0 beta. http://www.microsoft.com/downloads/details.aspx?FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3&displaylang=en   Training Jump start your development of Windows Phone 7 applications by attending Windows Phone 7 JumpStart. This free virtual live class, comprised of four instructor-led 3 hour sessions, will guide you in developing applications for...

posted @ Thursday, July 15, 2010 11:43 AM | Feedback (0)

Out of Process Session State and LINQ To SQL Entities

When using ASP.NET you can choose 4 different ways of storing session: In Process, State Server, SQL Server, or Custom. When using In Process the session is stored on the ASP.NET thread of the web server, but when using the State Server or SQL Server the sessions are stored outside the ASP.NET thread. When would you use Out of Process session state? Mostly when you have a web farm and you need to share the same session across all web servers. You might choose to use it even if you have one web server for the simple reason of saving...

posted @ Friday, November 13, 2009 11:56 AM | Feedback (2)

Sample Code for Getting the User Location based on the IP Address

Yesterday I introduced a free service to get the location of the IP Address. If you haven’t read it, go on read that first (it’s very short, I promise). So here I am today, showing you my small .NET API to abstract the XML returned by the service. First we need an object to hold the data. I called it UserLocation. 1: public class UserLocation 2: { 3: public string City...

posted @ Thursday, September 03, 2009 2:01 PM | Feedback (3)

Get Location of the IP Address

I wanted to share with all of you a free service that provides you an approximation of your user’s IP Address. You can read about it here: http://www.hostip.info/use.html. If you are looking for a more sophisticated solution that is maintained more often than the free solution you can also use this service: http://www.maxmind.com As of this writing you can get the response in 2 different forms: XML or plain text. I like the more structure formats so I will be using the XML option. Stay tune… I will post a C# API for retrieving the information. UPDATE:...

posted @ Wednesday, September 02, 2009 3:00 PM | Feedback (3)

Routing in ASP.NET 3.5 and 4.0

Routing was born with the creation of the asp.net MVC Framework. During the beta testing of the MVC framework people started asking for this feature to be included in asp.net so it could be used with web forms as well. The asp.net team listened and included Routing with the release of .net 3.5 SP1. Thanks for the history, but what exactly is routing? Routing enables you to use URLs that do not map to a physical location on the server. For example in a normal page request for the default.aspx resource there has to be a physical file default.aspx...

posted @ Friday, July 17, 2009 7:52 PM | Feedback (0)

Installing Visual Studio 2010 Beta on a Virtual Machine

For the release of Visual Studio 2010 RC (Release Candidate), Microsoft provided us with a fully installed VPC (Virtual Machine) image. For some reason they did not do the same for the release of Beta 1. I guess they wanted people to go through the installation so they can receive feedback and bugs for it. Anyway, if you want to install VS 2010 Beta in a Virtual Machine, I recommend watching this Channel 9 Videoby Brian Keller on how to download and install all the requirements. Keep in mind that Brian also installs VS Team Foundation Server which is not...

posted @ Saturday, June 13, 2009 10:39 AM | Feedback (3)

Full .NET Archive