XF – Setup your App and Emulator

My computer was having some issues and I had to rebuild it. Luckily with Windows 10, this has never been a faster process. I make heavy use of Visual Studio team services, GitHub and OneDrive so backups are pretty easy too.

One thing I was struggling restoring was the capability of debugging my Android Xamarin Forms app in the Visual Studio emulator. Every time I started it up, it would immediately stop. Looking at the error messages in the debug output showed messages around the mscorlib.dll.so library.

All credit to this fix goes to Joost van Schaik and his post. As luck would have it, this is how I fixed it the first time, I just couldn’t remember it!

First thing is change your android options. Right click on your “droid” project and select “Properties”. Click on “Android Options” and make sure that “Use Fast Deployment (debug mode only)” is unchecked.

fastdeployment

Next you need to go into your emulator settings and fix up the processor settings. Click on the start menu button and type “hyper” and select “Hyper-V Manager”.

Right-click on the desired emulator and select settings:

hypervmanager

It’s a little hard to see, but under the context menu, you can see KitKat which is the emulator that I have been using. Settings should give you the following screen. Expand the processor node, click on “Compatibility” and make sure “Migrate to a physical computer with a different processor version” is checked. Note that you will only be able to do this if the emulator isn’t running.

emulator-processor-compat

And that was it. Once I made these two changes, I was able to debug in Visual Studio once again.

Hope you find this helpful and that by doing this post, I will remember the next time I need to rebuild my dev environment! For links to more information on these settings, I would suggest checking out Joost’s post on this subject.

 


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s