Unable to handle EndPointNotFound exception on WP7

Over the last few days I have been working on an online high score for the Windows Phone 7 game ‘plan bee’, which is done in XNA. (I guess this problem is also relevant for Silverlight applications). I had the service setup and all were good, data were flowing back and forth. To give the player a good experience when playing the game I of course started to test the game without internet connection, as this can happen on a mobile device like WP7 Smile

Then the game crashed right away and at first I just thought I forget to check for something and attached the debugger. The debugger showed me that an EndpointNotFound exception were thrown. I tried a lot of things and couldn’t figure out how I could avoid or catch this exception!

Angry developer

[more]

I tried to put try/catch around the freaking method calling the service, but the exception still insisted on begin thrown right when I tried to access the service. WTF!

Then I started googling around the net to see if anyone else had the same problem – and apparently I were not along with this – lucky me. People were tried really creative things, that were…yeah creative… but also really stupid some of them and wouldn’t work in the long run.

Solution

Suddenly I came across this little thread: http://forums.create.msdn.com/forums/p/69485/435804.aspx#435804

babaandthepigman: “Isn’t this exception a ‘first-chance exception’ caught by the debugger?

face_palm

In my aggressive attempt to figure out why this exception were thrown, I never tried it without the debugger and never had the time to press F5 after I saw the exception in the debugger. If I had done that, I would have discovered that the game continued to run and that I went into my “_Completed” event handler method where I could have checked for e.Error != null and have done what I wanted – without the game crashing.
Stupid me!

The funny thing is that apparently is that a lot of people have done this – you might be one of them as you are reading this post Smile Even funnier is how the thread just stops after the quoted comment above.

Hope this helped you with this “problem”.

– Enjoy!

ExEn: XNA for iPhone, Android and Silverlight

Some days ago I discovered this very promising platform for game developers.

What is ExEn?
Currently ExEn is an implementation of a subset of the Microsoft XNA Framework API that runs on iPhone and Silverlight. It is based on XnaTouch and SilverSprite – but most of the important bits have been rewritten – most importantly the rendering, audio, input and timing systems.

[more]

If Andrew can actually do what he says, which I think and hope he can, this platform is a must-have for all game developers interesting in hitting as many platforms as possible, with as little code differences as possible.

Andrew is asking for 10.000$ in funding to make this platform ready for the public in form of an open source project.

Please take a look at his RocketHub.com site and fuel the project if you find it interesting – I know I am Smile
http://rockethub.com/projects/752-exen-xna-for-iphone-android-and-silverlight

Silverlight GeekNight Alpha

Last night we hosted our first “GeekNight” in the “Silverlight Developers in Denmark” group.
It turned out to be a big success. Well, I can’t talk for the others, but personally I think it was a big success and it seemed like the others at the event had the same experience as me.

So what is a GeekNight?

halfgeek

[more]

Actually the concept of a GeekNight, at least how we define it, is very simple.
Put together some “geeks” (developers) in a room and let them code some Silverlight.
That’s basically it. All participants coded on their own stuff. Some knew what they would code on from the beginning and others started out by talking with others about ideas for something to look into.

What worked really well was the way you could just ask questions and have an answer or dialog about it right away. Guess we all know the feeling of having a problem which is either to minor to compensate for effort of creating a post on Stack Overflow or else where, or to complex to describe in such forum. Yesterday I ran into one of these and could right away as a person about how he usually solved that. Before that I didn’t knew if I were the only one with this problem or just to stupid to figure out how to solve it Smile
By talking to one of the other participants I found out that there weren’t any “easy” solution for this and we had a great chat about the problem.

That was really great!

Another great thing were the huge difference in level of experience with Silverlight. Some had no experience with Silverlight at all and were starting the event by installing the tools. Others were people making a living of doing only Silverlight development. So there were room for all kinds of questions Smile

I’m looking forward to the next “GeekNight” and hope we will have some great coding hours together.

Sign up for the next event here: http://www.eventbrite.com/event/1178036539

My GeekNight project

I personally had a plan from the beginning of the event. I wanted to convert my game “Balloon Mayhem” to an Windows Phone 7 game. It actually turned out pretty great with a semi working game, integrated with an online hiscore. Here is some of the screenshots I tweeted during the process.

227605234

The game didn’t get done at that night, but that’s ok. I learned a lot as I played around with some WP7 Silverlight controls like Pivot control and page navigation on the phone.

Hopefully I will get the game done one day and you can then find it in the marketplace, but I’ll let you know when that happen. Maybe after the next GeekNight? Who knows.

– Enjoy!