MikeScott8 Programming Thoughts

My musings, ponderings, and other posts on programming. And maybe gadgets and other nerd stuff.

Leave a comment

Xamarin.Forms and Azure issue

So we recently added in some Nuget packages to our Xamarin Forms solution for a project I am on at my work. When you create a “Mobile App” on Microsoft Azure under the QuickStart section they provide Xamarin.Forms instructions and even a sample solution you can download. Since we already had a solution started we followed the other option “Connect an existing app”, well mostly, but more on that in a second.

The code was put into the solution and Nuget packages added to proper projects in the solution. Then since we are using Windows computers our client provided us with, it is easier to do first dubugging and testing on Android simulator on the local PC. After all that was done and it seemed to be working then we started testing on iOS simulator, remotely, from the client provided Mac Mini we have to use for iOS building and testing.

That’s when we started having an error pop up on the application starting up.

The error message we started getting was:
“A Microsoft Azure Mobile Services assembly for the current platform was not found. Ensure that the current project references both Microsoft.WindowsAzure.Mobile and the following platform-specific assembly: Microsoft.WindowsAzure.Mobile.Ext.”

Did the usual trouble shooting and making sure we had the right Nuget packages and no extra conflicting packages. After a few dead ends we went and Googled it with Bing.

The page found in the searching for the fix for this error:

The second reply was the one that contained the line we (I, cough cough) missed. The line to initialize the mobile services wasn’t present and it is needed in iOS but the Android worked without it.

Leave a comment

Rhino Mocks Basics and Link to Wiki

I’ve been a user MOQ to mock objects for my unit testing over the years. I recently started on a project that is using Rhino Mocks (for certain layers, but that’s another topic entirely! haha).

I was able to get a bunch of simple tests done, but once I got to more advanced tests and started needing to have my “Expect” setups (and “AssertWasCalled” verification) to check what parameters were passed I ran into slight problems. I started looking online for how Rhino Mocks did it. I did a search and the first link I found (http://hibernatingrhinos.com/Oss/rhino-mocks/learn) was woefully light.

I did some more searching and found the following:


Which provided some good examples and links to other posts discussing Stub/Mock and other features. But one link was to another post by the same author about a discussion he had with a coworker about “VerifyAll” vs “AssertWasCalled” and that lead me to find the wiki for Rhino Mocks. And one section there was most of what I was looking for, how to check values on parameters to methods you setup for the test.

Rhino Mocks 3.5 wiki Constraints

I had not seen the this wiki in my search results. Wikis are not usually in my searching, so this post is mainly for me for future reference. And maybe someone will find this post someday and it will lead them to the wiki faster. At least that’s my hope.

1 Comment

Modernization of NWVDNUG site

Today is my first day of some downtime between clients. Hopefully it’s short one. So today I was doing some learning and trying to figure out what to study. One potential opportunity for me is with an existing client and “modernizing” a bunch of their internal applications.

I also had some updates that needed to be done on the website for the user group I run with Barry Stahl. I had just in the past month, to move to a new work computer when the old one’s lease was up. Due to this fact, the Windows Virtual Machine on the machine used for windows development I had only installed Visual Studio 2015 on.

I connected to Github from inside VS2015 and cloned the repo for the website for my user group. But when I went to open it I got several issues from the conversion report. The main issue that was not able to be automatically updated by VS is the fact that I had written the site in an older version of MVC framework.

Following the link from the conversion report took me to MSDN article that had a link to:


So I figured I’d take on this “modernization” of the user group site as a learning tool in case this comes up for future work I have to do.

Following the steps on the linked page I did the following:

  • Update the version numbers in the Web.config files (steps 1 and 2)
  • For step 3 I couldn’t do as it wouldn’t even load into Solution explorer. I am skipping it and will come back to it later, if needed.
  • Did step 4 to edit the csproj file.
  • Replaced the guid as listed in step 5
  • In step 6, I saved the file but couldn’t reload it in VS. So I closed VS and tried reopening (with fingers crossed). It still wouldn’t show in VS, so I closed VS again and continued with step 7 for now.
  • Manually added/updated the code listed in step 7

I was hoping these steps would work, but it didn’t seem to. I didn’t want to do what it said was the easiest way to do it, “The simplest way to upgrade is to create a new ASP.NET MVC 4 project and copy all the views, controllers, code, and content files from the existing MVC 3 project to the new project…” I didn’t want to do this as I wanted to keep the current repo, and all this changes to a whole new project and file structure would be a mess of a commit.

Watch for second post soon, covering how simple this “simplest way” is.

Leave a comment

Task.Status refresher and thanks to Jeremy Clark

Last month (Sept 2015) at the user group I help run (http://nwvdnug.org) we had the pleasure of Jeremy Clark come out and give a talk on Task, Await and Async programming.

I’ll Get Back to You: Task, Await, and Asynchronous Methods

There’s a lot of confusion about async/await, Task/TPL, and asynchronous and parallel programming in general. So let’s start with the basics and look at how we can consume asynchronous methods using Task and then see how the “await” operator can makes things easier for us. Along the way, we’ll look at continuations, cancellation, and exception handling.

One of the things he covered was something I saw a fellow programmer at work run into. The issue is when a Task completes you have a couple properties “IsFaulted”, “IsCompleted”, and “IsCanceled” and the fact that IsCompleted just means it is done running and this is set to true even if faulted. Therefore you cant use it to tell that the task ran to completion SUCCESSFULLY.

I remembered in the talk this came up and was discussed and way to handle it nicely was given. I could not recall exactly the way Jeremy showed that handled it and went searching for more on his site. I found the following post


And reading through that post I found the information I wanted.

Thanks again Jeremy! And if you are near anyplace he speaks (which is LOTS of places) I would go see him. He is a really good presenter and covers his topics in a well organized way and really gets the concepts across well.

Check his site and his upcoming speaking is right on his home page.

Leave a comment

Great tip for testing web apps

I often ran into the issue when testing and debugging web applications and sites that I would often have to clear cookies and caches in order to effectively work.

This tip posted by Scott Hanselman is a good one, I had not heard of, let alone thought of. In his post he talks about adding Chrome in incognito mode and Internet Explorer in private mode to Visual Studio. Both of these effectively means any cookies or cached data you create during that session would/should be removed when you close that browser. This should make it easier than having to manually clear that data when testing.

Leave a comment

Quick Unit Testing Thought

Just a quick thought I had the other week while driving to work.

I was driving to work and thinking about a unit test I had been in process of writing the previous night and what assertions I had to add to it. And just from that realized I had written my service that was being tested with multiple database calls that could be reduced to one, and then some local filtering in the service.

So just the THINKING of my unit tests, led me to some reduction in the service to database calls.

That’s all just a quick random development thought I wanted to pass on.

Leave a comment

Async Await deadlock issues

So today while refreshing my skills on WPF I also used some async and await methods and ran into a deadlock issue.

did a quick search and found (on StackOverFlow of course) this Question and answer


This answer lead me to:



Leave a comment

Keep IIS Express running site after debugging stops

Since I just had to find this again, since its so disjointed setting (in my mind) that fixes it, I am posting here fro future reference by me. Now I will just have to remember that I posted a link to this blog for it 🙂


Leave a comment

My First Windows 8 Application

Well last night I got an email back from the Windows Store certification process saying the second submission of my first windows 8 application was approved. The first submission had some minor issues, and although the report wasn’t perfectly clear on what was wrong I was able to take a guess at what those issues were.

Just like with Windows Phone I used the user group I run in the Northwest Phoenix valley (Site) as subject matter for the application. This is a “minimum viable product” version of the application, so is fairly basic and not that pretty looking. More features and some good UI/UX cleanup will be coming in future versions of the application.

NWVDNUG Meeting Info

Please check it out and install it if you use Windows 8 and leave a review (taking into account it’s a first version with planned updates coming when I can) if you feel inclined to do so.