Building a Windows Phone 7 App using JSON/ASP.NET MVC Data Service Layer
I had a great time speaking at Charlotte’s Enterprise Developers Guild last night. Here is a link to my slides and sample code.
Thanks again to everyone who came out!
Categories: English
ASP.NET MVC, JSON, Silverlight, Speaking, WP7



Hi Matt,
I just downloaded your code and there are a couple problems:
(1) the Charlotte.WP7.Models folder’s Game.cs and NotifyObject.cs files have D:\Work\… paths. I think this is resolved by deleting those files and replacing them with the same files in the Charlotte.Web project (?)
(2) the Charlotte.Web project won’t load. The error message says “The project type is not supported by this installation.” although I’m running Visual Studio 2010 Ultimate.
Any idea what I can do to fix this?
Thanks,
Dan
Dan,
I am using the MVC 3 addin as well. If you use the WebPlatformInstaller from Visual Studio you can add this. Let me know if that allows you to open the Web project.
Regards,
Matt
Hi Matt,
Installing the Web Platform resolved issue #2 (but that installation took forever!) – the code now compiles, runs in the emulator, and seems to work. I had Visual Studio set up the website, but when it automatically opens the http://localhost:4204 page, I get a server error in the browser:
Server Error in ‘/’ Application.
——————————————————————————–
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been
removed, had its name changed, or is temporarily unavailable. Please review the following URL and make
sure that it is spelled correctly.
Requested URL: /
I’m assuming that was not supposed to happen – ?
Thanks,
Dan
Dan,
Resolving issue #1 is a matter of removing the files and adding them as Linked files again. I am sharing those objects between client and server. The links were still relative to my machine and that is why you were getting that error.
As far as the 404, I am not sure what is happening. Let me try and replicate it or you perhaps you could zip up your solutions and let me see what is happening.
Regards,
Matt
Hi Matt,
Thanks – I just changed those files to be linked files again. Still getting the 404 – will email you the zip in a minute…
Thanks,
Dan
Dan,
I had a chance to go through your project. When I opened up the project I got the dialog about remapping the URL to the Web project’s folder. That is normal.
The other question about the 404. That is to be expected since my example was using MVC purely as a data access mechanism and no UI. I forgot that I pulled any views for the HomeController by design so that I was using it strictly to give me data. You can change or modify this to whatever you want but this example was for piping data to WP7.
So to answer your questions, it is working exactly as planned.
I would make sure the WP7 project is set as your startup project.
Regards,
Matt
Hi Matt,
I should have realized that about the Web service project not having a UI.
Thanks for the code & for the quick replies – much appreciated!
Dan
Some genuinely wonderful articles on this website , thankyou for contribution. cpanel reseller | reseller web hosting |