<!DOCTYPE html>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Oren Novotny</title>
        <link rel="pingback" href="http://oren.codes/xmlrpc.php">
        
                
        <link rel="alternate" type="application/rss+xml" title="Oren Novotny &raquo; Feed" href="http://oren.codes/feed/" />
<link rel="alternate" type="application/rss+xml" title="Oren Novotny &raquo; Comments Feed" href="http://oren.codes/comments/feed/" />
		<script type="text/javascript">
			window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/oren.codes\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.2.4"}};
			!function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
		</script>
		<style type="text/css">
img.wp-smiley,
img.emoji {
	display: inline !important;
	border: none !important;
	box-shadow: none !important;
	height: 1em !important;
	width: 1em !important;
	margin: 0 .07em !important;
	vertical-align: -0.1em !important;
	background: none !important;
	padding: 0 !important;
}
</style>
<link rel='stylesheet' id='mediaelement-css'  href='http://oren.codes/wp-includes/js/mediaelement/mediaelementplayer.min.css?ver=2.16.2' type='text/css' media='all' />
<link rel='stylesheet' id='wp-mediaelement-css'  href='http://oren.codes/wp-includes/js/mediaelement/wp-mediaelement.css?ver=4.2.4' type='text/css' media='all' />
<link rel='stylesheet' id='gitsta-style-css'  href='http://oren.codes/wp-content/themes/gitsta/style.css?ver=4.2.4' type='text/css' media='all' />
<link rel='stylesheet' id='bootstrap-css'  href='http://oren.codes/wp-content/themes/gitsta/vendor/bootstrap/css/bootstrap.css?ver=4.2.4' type='text/css' media='all' />
<link rel='stylesheet' id='font-awesome-css'  href='http://oren.codes/wp-content/themes/gitsta/vendor/font-awesome/css/font-awesome.css?ver=4.2.4' type='text/css' media='all' />
<link rel='stylesheet' id='octicons-css'  href='http://oren.codes/wp-content/themes/gitsta/vendor/octicons/css/octicons.css?ver=4.2.4' type='text/css' media='all' />
<link rel='stylesheet' id='jetpack_image_widget-css'  href='http://oren.codes/wp-content/plugins/jetpack/modules/widgets/image-widget/style.css?ver=20140808' type='text/css' media='all' />
<link rel='stylesheet' id='jetpack_css-css'  href='http://oren.codes/wp-content/plugins/jetpack/css/jetpack.css?ver=3.6.1' type='text/css' media='all' />
<script type='text/javascript' src='http://oren.codes/wp-includes/js/jquery/jquery.js?ver=1.11.2'></script>
<script type='text/javascript' src='http://oren.codes/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
<script type='text/javascript' src='http://oren.codes/wp-content/themes/gitsta/vendor/bootstrap/js/bootstrap.js?ver=4.2.4'></script>
<script type='text/javascript' src='http://oren.codes/wp-content/themes/gitsta/vendor/marked.js?ver=4.2.4'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var theme = {"template_directory_uri":"http:\/\/oren.codes\/wp-content\/themes\/gitsta"};
/* ]]> */
</script>
<script type='text/javascript' src='http://oren.codes/wp-content/themes/gitsta/js/main.js?ver=4.2.4'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://oren.codes/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://oren.codes/wp-includes/wlwmanifest.xml" /> 
<meta name="generator" content="WordPress 4.2.4" />
<link rel='shortlink' href='http://wp.me/4Mzfv' />
<script type="text/javascript">
            var appInsights=window.appInsights||function(config){
                function s(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},r=document,f=window,e="script",o=r.createElement(e),i,u;for(o.src=config.url||"//az416426.vo.msecnd.net/scripts/a/ai.0.js",r.getElementsByTagName(e)[0].parentNode.appendChild(o),t.cookie=r.cookie,t.queue=[],i=["Event","Exception","Metric","PageView","Trace"];i.length;)s("track"+i.pop());return config.disableExceptionTracking||(i="onerror",s("_"+i),u=f[i],f[i]=function(config,r,f,e,o){var s=u&&u(config,r,f,e,o);return s!==!0&&t["_"+i](config,r,f,e,o),s}),t
            }({
                instrumentationKey:"86618b01-9585-4f30-9f3e-36b532155f9b"
            });
    
            window.appInsights=appInsights;
            appInsights.trackPageView("Home", window.location.origin + "/Targeting%20.NET%20Core");
        </script><script type="text/javascript"> 
    var analyticsFileTypes = [''];
    var analyticsSnippet = 'disabled';
    var analyticsEventTracking = 'enabled';

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
	ga('create', 'UA-44640903-2', 'auto');
 
	ga('send', 'pageview');
</script>

<link rel='dns-prefetch' href='//jetpack.wordpress.com'>
<link rel='dns-prefetch' href='//s0.wp.com'>
<link rel='dns-prefetch' href='//s1.wp.com'>
<link rel='dns-prefetch' href='//s2.wp.com'>
<link rel='dns-prefetch' href='//public-api.wordpress.com'>
<link rel='dns-prefetch' href='//0.gravatar.com'>
<link rel='dns-prefetch' href='//1.gravatar.com'>
<link rel='dns-prefetch' href='//2.gravatar.com'>

<!-- Jetpack Open Graph Tags -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Oren Novotny" />
<meta property="og:description" content="Thoughts on Software Development" />
<meta property="og:url" content="http://oren.codes/" />
<meta property="og:site_name" content="Oren Novotny" />
<meta property="og:image" content="https://s0.wp.com/i/blank.jpg" />
<meta property="og:locale" content="en_US" />
<meta name="twitter:site" content="@onovotny" />
    </head>

    <body class="home blog">
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <!-- Nav button for small resolutions -->
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-menu">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    
                    <a class="navbar-brand" href="http://oren.codes">Oren Novotny</a>
                </div>
                <div class="collapse navbar-collapse" id="main-menu">
                    <ul id="menu-top-menu" class="nav navbar-nav"><li id="menu-item-431" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-431"><a title="About" href="http://oren.codes/about/">About</a></li>
<li id="menu-item-1091" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1091"><a title="Projects" href="http://oren.codes/projects/">Projects</a></li>
</ul><form role="search" method="get" id="searchform" action="http://oren.codes/" class="navbar-form navbar-left">
    <div>
        <input type="text" value="" name="s" id="s" placeholder="Search..." class="form-control">
    </div>
</form>                    <div class="btn-group pull-right">
                                                <a href="#" class="btn navbar-btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> Anonymous <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="http://oren.codes/wp-login.php">Login</a></li>
                            <li class="divider"></li>
                            <li><a href="http://oren.codes/wp-login.php?redirect_to=http%3A%2F%2Foren.codes%2F2015%2F07%2F29%2Ftargeting-net-core%2F">Register</a></li>
                            <li><a href="http://oren.codes/wp-login.php?action=lostpassword">Lost password</a></li>
                        </ul>
                        
                                            </div>
                </div>
            </div>
        </nav>
        <!-- Anchor for "Back to top"-Link -->
        <a name="top"></a>
                
    <div class="container">
        <div class="row">
            <div class="col-md-10" style="min-height: 230px;">
                
                    
                        <div id="post-2681" class="item post-2681 post type-post status-publish format-standard hentry category-uncategorized tag-net-core tag-coreclr tag-dotnet tag-uwp tag-windows-10">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/07/29/targeting-net-core/" name="2681" rel="bookmark" class="post-title">Targeting .NET Core</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            July 29, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/net-core/" rel="tag" class="label label-primary">.net core</a>, <a href="http://oren.codes/tag/coreclr/" rel="tag" class="label label-primary">coreclr</a>, <a href="http://oren.codes/tag/dotnet/" rel="tag" class="label label-primary">dotnet</a>, <a href="http://oren.codes/tag/uwp/" rel="tag" class="label label-primary">uwp</a>, <a href="http://oren.codes/tag/windows-10/" rel="tag" class="label label-primary">windows 10</a>        </p>
    </div>
    <div class="post-content">
        <h1 id="targetingnetcore">Targeting .NET Core</h1>
<h2 id="problem">Problem</h2>
<p>Since DNX was announced, library authors have been inundated with requests to support <a href="http://blogs.msdn.com/b/dotnet/archive/2014/12/04/introducing-net-core.aspx">.NET Core</a> and the CoreCLR. Up until now, the only real option was to use the DNX-based <code>project.json</code> build system with the Visual Studio <code>xproj</code> projects. Adding these project types into an existing project that already supports a wide-range of platform targets can be challenging. There are a few issues with the current approach:<br />
&#8211; Not all project types can be built with project.json<br />
&#8211; It&#8217;s been a moving target as DNX is rightfully still in beta.<br />
&#8211; Without proper guidance, authors have been targeting <code>dnxcore50</code> in their packages intended for .NET Core instead of <code>dotnet</code><br />
    &#8211; To be fair, <code>dotnet</code> is a <a href="//oren.codes/2015/06/16/demystifying-pcls-net-core-dnx-and-uwp-redux/">recent update</a> that has been little publicized</p>
<p>Starting today though, there&#8217;s a better way. Just make sure to install the <a href="https://dev.windows.com/en-us/downloads">Windows developer tooling</a> as it includes this new functionality.</p>
<h2 id="terminology">Terminology</h2>
<p>If we go back to the .NET Core presentation back in November, you may remember this diagram:<br />
<img src="//blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-12-34/2783.Pic3.png" alt="" title="" /></p>
<p>In terms of terminology, .NET Core should be your target; CoreCLR is just a runtime. Referring to the diagram, the <code>dnxcore50</code> Target Framework Moniker refers to the box in the upper-right &#8212; it&#8217;s the ASPNet 5 app model. It is BCL + DNX specific libraries. Similarly, <code>uap10.0</code> is the Windows Universal app model, BCL + Windows Runtime.</p>
<p>Many (most?) libraries do not actually need the DNX or WinRT dependencies. All they really need are the BCL libraries. What then is the target there? The answer is <code>dotnet</code>. By using <code>dotnet</code>, you instead specify your dependencies in your nuget package and your package will then run on any supported runtime, including CoreCLR, .NET Native and .NET 4.6 (assuming you&#8217;re using the newest BCL packages.)</p>
<h2 id="existinglibraries">Existing Libraries</h2>
<p>What has been lost in the commotion around DNX, CoreCLR and .NET Core is the fact that &#8220;Profile 259&#8243;+ Portable Class Libraries, class libraries that target a minimum of .NET 4.5, Windows 8 and Windows Phone 8, can run on CoreCLR as-is. You do not need to create a new project or target newer contract/BCL references. All you need is to put your existing library into <code>\lib\dotnet</code> in your NuGet package in addition to the <code>\lib\portable-*</code> directory it is now and list your dependencies in the package.</p>
<p>The only time you might need a new project is if you have platform-specific code. In that case, the new UWP tools for Windows 10 has a better option: &#8220;Modern PCLs&#8221;. Once you install the UWP tools, create a new <code>Class Library (Portable)</code> in your solution and make sure only .NET 4.6, Windows Universal 10 and ASP Net 5 is checked. When you do that, you&#8217;ll get a modern PCL that uses <code>project.json</code> and pulls in the newest .NET Core packages as references. You can then use linked files, shared projects and your existing techniques to build a class library that targets .NET Core. Then, put that in your <code>\lib\dotnet</code> directory and create the dependencies element for it. No magic needed. Using this technique, I was able to adapt several OSS libraries to support .NET Core in very little time.</p>
<h2 id="nugetdependenciestheheartofdotnet">NuGet Dependencies &#8211; the heart of <code>dotnet</code></h2>
<p>As I described in my previous <a href="//oren.codes/2015/06/16/demystifying-pcls-net-core-dnx-and-uwp-redux/">post</a>, the key to making <code>dotnet</code> work is specifying all of your dependencies. This can be a tedious and error-prone process. I&#8217;ve built a tool, <a href="https://github.com/onovotny/ReferenceGenerator">NuGet.ReferenceGenerator</a> that automates creation of the dependency element for the majority of cases. The tool works with either existing compatible PCL projects and the new &#8220;modern PCL&#8221; projects.</p>
<p>Just add the <code>NuSpec.ReferenceGenerator</code> NuGet to your package and build. I won&#8217;t go over all of the docs, but you can find those on the <a href="https://github.com/onovotny/ReferenceGenerator">project site</a>.</p>
<p>At build time, the tool will read the references your assembly requires, determine the source NuGet package and version, and create the <code>&lt;dependencies&gt;</code> element in the NuSpec.</p>
<h2 id="calltoaction">Call To Action</h2>
<ul>
<li>If you maintain a library, review any areas where you are currently targeting <code>dnxcore50</code> and update your NuGet package to put those bits in <code>dotnet</code>. If you are not using any <code>Microsoft.Dnx</code> references, and the majority of libraries do not, then there&#8217;s no reason to target <code>dnxcore50</code> when <code>dotnet</code> reaches a far broader set of targets.
<ul>
<li><strong>Bonus</strong> by using the &#8220;Modern PCL&#8221; projects and/or reusing your existing PCL, your dependencies will be the stable versions, not pre-release. That means your package can be stable too and not wait until <a href="https://github.com/aspnet/Home/wiki/Roadmap">Q1 2016</a>!.</li>
</ul>
</li>
<li>If you currently have a library that&#8217;s a &#8220;System.Runtime&#8221;-based PCL, one that&#8217;s at least <code>portable-win8+net45+wp8</code>, then simply add a copy of the binary to your NuGet package in the <code>dotnet</code> directory. Adding it to <code>\lib\dotnet</code> and leaving a copy in <code>lib\portable-win8+net45+wp8</code> allows it to work with .NET Core and the existing NuGet v2 clients.</li>
<li>Ensure your NuGet package lists all of its dependencies in a <code>&lt;dependencies targetFramework="dotnet"&gt;</code> element. Use the stable package versions, not the DNX pre-release versions. If you don&#8217;t want to create and maintain this by hand, use my <a href="https://github.com/onovotny/ReferenceGenerator">ReferenceGenerator</a>.</li>
<li>Last, but most importantly, make sure your <code>nuget.exe</code> version is up-to-date by running <code>nuget update -self</code>. Version 2.8.6 or later is required to properly package <code>dotnet</code>.</li>
</ul>
    </div>
</div>
                    
                        <div id="post-2461" class="item post-2461 post type-post status-publish format-standard hentry category-uncategorized tag-dotnet tag-pcl tag-uwp tag-windows-10">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/06/16/demystifying-pcls-net-core-dnx-and-uwp-redux/" name="2461" rel="bookmark" class="post-title">Demystifying PCLs, .NET Core, DNX and UWP (Redux)</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            June 16, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/dotnet/" rel="tag" class="label label-primary">dotnet</a>, <a href="http://oren.codes/tag/pcl/" rel="tag" class="label label-primary">pcl</a>, <a href="http://oren.codes/tag/uwp/" rel="tag" class="label label-primary">uwp</a>, <a href="http://oren.codes/tag/windows-10/" rel="tag" class="label label-primary">windows 10</a>        </p>
    </div>
    <div class="post-content">
        <p><em>[Disclaimer: Many of the things I talk about here may not work in the RC of Visual Studio 2015. The information is taken from Microsoft’s public repos on GitHub and from conversations with members of the .NET team. The information herein is accurate at the time of writing but as with everything pre-release, things may change!]</em></p>
<h2 id="intro">Intro</h2>
<p>A few days ago, I posted an <a href="/2015/06/09/pcls-net-core-dnx-and-uwp/">article</a> trying to explain my current understanding of how the new .NET Core libraries fit into the existing ecosystem. Since then, I’ve had more conversations with a few people on the .NET Team (many thanks to <a href="https://twitter.com/davkean">David Kean</a> and <a href="https://twitter.com/theesj">Eric St. John</a>!) that clarify the meaning of the <code>dotnet</code> target framework and how the pieces all fit together. This blog will attempt to explain further.</p>
<h2 id="tldr">TL;DR</h2>
<p><code>dotnet</code> is not a specific target framework—it means “I’m compatible with any target framework that my dependencies are compatible with.” Read on for more.</p>
<h2 id="letsstartattheverybeginningaverygoodplacetostart">Let’s start at the very beginning (a very good place to start!)</h2>
<p>To help explain where things are going, it helps to have some background for context. Before we had any such thing as Portable Class Libraries (PCLs), if we wanted to use a library on multiple frameworks, we had to compile it multiple times. The figure below illustrates the state of the world circa 2010.<br />
<img src="/wp-content/uploads/2015/06/before-pcls.png" alt="Before PCLs" title="Before PCLs" /></p>
<p>The only real strategy for code sharing was to use linked files and many <code>#ifdef</code>s, as there were wide differences in capabilities between the frameworks. A solution would contain multiple projects, one per target framework. Each project would contain platform-specific references and would generate a binary compatible only with its target platform. This situation was not scalable as future frameworks and platforms would only lead to even more file linking.</p>
<h2 id="thebirthofpcls">The birth of PCLs</h2>
<p>In early 2011, Microsoft <a href="https://msdn.microsoft.com/en-us/library/gg597391(v=vs.100).aspx">released</a> the first version of Portable Class Libraries as a <a href="https://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981/">toolset</a> for Visual Studio 2010. These tools allowed creation of single binary targeting the .NET Framework, Silverlight, Windows Phone 7 and Xbox 360. They accomplished this by finding the lowest common denominator of functionality shared among the target frameworks. The available functionality changed to match your selection:<br />
<img src="/wp-content/uploads/2015/06/pcl-target-frameworks-dialog.png" alt="PCL target framework dialog" title="The original PCL target frameworks" /></p>
<p>From this early start, the tools grew over time. Visual Studio 2012 included support for PCLs without the need for an add-in. The list of target frameworks and versions increased; now you could choose .NET Framework 4 or 4.5. You could choose Silverlight 4 or Silverlight 5. Windows Phone gained options for 7.5, 8 and 8.1. We saw support added for additional platforms like Windows 8 and 8.1 Store applications. In 2013, Windows Phone App 8.1 made its first appearance. In early 2014 Xamarin added support for Portable Class Libraries, providing additional target frameworks for their iOS and Android platforms.</p>
<h2 id="makingthesausage">Making the sausage</h2>
<p>They say that if you enjoy eating sausage, you should never see how it’s made. I personally don’t find ignorance to be bliss and strive to understand how things are made. The same could be said for PCLs—don’t look under the covers unless you’re prepared for what you may see! As one might imagine, there’s quite a bit going on to enable PCLs. In the current system, there are really two main components: contract assemblies and profiles.</p>
<h3 id="contractassemblies">Contract Assemblies</h3>
<p>Contract assemblies are a special kind of assembly that contains types/metadata but no actual implementation. Think of this as a compile-time reference. A library can reference one or more contract assemblies and the compiler will use the type information in the file. At runtime, when a type is requested from the contract assembly, the loader sees either a <code>TypeForwarder</code> pointing to a concrete implementation or assembly metadata indicating redirection is allowed for the library. The indirection enables types to live in different assemblies in the implementation (think Silverlight vs .NET) but be referenced from a single dll. It also enables the runtime to substitute one type for another even if the assembly versions don’t match.</p>
<p>The best way to think of a contract assembly is like a promise that a specified surface area is present. Your library can reference that assembly and then it’ll run on any target framework that implements that contract. Not all target frameworks support all versions of a particular contract. When working with a least-common-denominator based system, like PCLs, you’ll see fewer types available when you check more/older target frameworks. What Microsoft has done is pre-generate all of the permutations of those checkboxes so that you have a contract assembly for each possible option.</p>
<h3 id="profiles">Profiles</h3>
<p>That leads us squarely into PCL profiles. These are the things like <code>Profile259</code> or <code>Profile78</code> that people most associate with PCLs. In order to support every permutation of target frameworks that you, as a library author, want to choose, Microsoft pre-computed over fifty profiles to date. The profiles are collections of contract assemblies that represent the intersections of the public surface area from the targets. What people really mean by saying <code>Profile259</code> is that they’re targeting .NET 4.5, Windows 8, Windows Phone 8 Silverlight and Windows Phone 8.1. The number is just a shorthand for spelling out each target framework. It was never really the intent for the profiles to be what people talked about, it was always supposed to be about the target platforms.</p>
<p>What each profile represents, then, is a set of contract assemblies supported by a set of target frameworks. The profiles, in sum, represent every combination of possible contract assemblies. Taken one step further, what ultimately matters to a library isn’t the target framework; rather, what matters to a library are the contracts available to it through the selected set of target frameworks. The profile itself is just a transitive way to get that set of contracts.</p>
<h2 id="enterthenuget">Enter the NuGet</h2>
<p>It’s not possible to have a complete discussion about PCLs without mentioning NuGet. In parallel to the rise of PCLs, community support was growing around using NuGet (and its package format by extension) as the de facto way of distributing library components. One of a NuGet’s key features is the ability to support multiple target platform versions within a single package. NuGet accomplishes this by using Target Framework Monikers (TFMs) that represent each platform. For example, <code>net</code> means .NET Framework, <code>wp</code> is Windows Phone and <code>netcore</code> is Windows Store. NuGet adds a version number to the TFM so that we get the common usage: <code>net45</code>, <code>wp8</code>, <code>netcore451</code>, which translates to .NET 4.5, Windows Phone 8 and .NET Core 4.5.1 (Windows 8.1) respectively. PCLs are supported in NuGet by using the portable TFM combined with the set of supported TFMs that the library targets. Using our earlier example of PCL <code>Profile259</code>, that would be <code>portable-net45+netcore45+wpa81+wp8</code> inside a NuGet package.</p>
<h2 id="thebreakingpoint">The breaking point</h2>
<p>There are two breaking points in this system: 1) Library authors need to update their NuGet packages to specify compatible targets, and 2) Using pre-computed contracts for PCLs is not scalable. This summer, two new runtimes, CoreCLR and .NET Native are being introduced; the desktop .NET Framework has a new 4.6 version coming out too. At the same time, a new application platform, the .NET Execution Environment (DNX), on which ASP.Net 5 is based, and a new version of the Windows “modern” platform, the Universal Windows Platform (UWP), are set to appear. It was time for a change. Adding support for UWP and DNX in combination with CoreCLR, Desktop .NET and .Net Native would be untenable with pre-computing contracts. Further, with .NET Core becoming Open Source and moving to GitHub, .NET 4.6, CoreCLR and .NET Native would support an application-local Base Class Library (BCL). The surface area available to those newer platforms was poised to explode.</p>
<p>To make the issue concrete, let’s look at an example. Most people are likely familiar with the <code>Newtonsoft.Json</code> NuGet package for working with JSON data. The library, Json.NET, aims to support every .NET platform available. In addition to compiling the code many different times with <code>#ifdef</code>s to accommodate older platforms, as new platforms appear, the Json.NET author needs to update the NuGet package too. That means that as new platforms like UWP and DNX appear, despite targeting a set of contract libraries (remember, all libraries really reference contracts, not platforms), the author needs to keep updating packages to add each new platform to the supported platform list.</p>
<p>What we’re experiencing here is an impedance mismatch between what the library cares about and what NuGet supports. The mismatch highlights, as fundamentally broken, a model that puts the onus on each library author to keep up-to-date with the available platforms and contract-to-platform support matrix. Libraries that would otherwise work on a target platform may not be understood as compatible by NuGet. While it is true that NuGet has a set of heuristics to accommodate additional platforms, the heuristics are also not scalable as they’re hard-coded into each NuGet client version.</p>
<h2 id="fixingtheimpedancemismatchdotnettotherescue">Fixing the impedance mismatch: <code>dotnet</code> to the rescue</h2>
<p>Over the past year, as “One Microsoft” has taken hold, you started to see the NuGet and .NET CLR teams work much closer together. Based on community feedback, NuGet was chosen as the de facto mechanism to deliver future versions of .NET that can run as self-contained app-local packages. In order to support the ever-increasing complexity placed upon it, NuGet had to evolve. You can read more about NuGet’s evolution to 3.0 on the NuGet team <a href="http://blog.nuget.org/archive.html">blog</a> in posts from April 2014-November 2014.</p>
<p>One of the most recent changes to NuGet, and the .NET ecosystem by extension, is support for the <code>dotnet</code> TFM. The meaning of <code>dotnet</code> wasn’t clear at first and as reflected in my earlier <a href="/2015/06/09/pcls-net-core-dnx-and-uwp/">blog post</a>, it seemed like it was the new target for the “new” portable .NET packages being published to NuGet and consumed by DNX and UWP. The reality isn’t quite like that but is far more interesting. Rather than <code>dotnet</code> representing a particular target like <code>netcore45</code>, <code>dnxcore5</code> or <code>net46</code>, it really means “I’m compatible with any targets that my dependencies are, check those.” It gets NuGet out of the platform guessing game and instead walks the dependency graph.</p>
<p>Practically speaking, the most common set of dependencies for any package will be its contracts – the assemblies referenced at build time. Today, with the platform-TFMs, those contracts don’t need to be listed in the NuGet package as they’re implied by the TFM. With the <code>dotnet</code>-based TFM, NuGet packages will have to specify their dependencies, even system ones. You can see this today with the <code>project.json</code> file that DNX projects use. By explicitly listing the dependencies (which may be CLR contracts), the mismatch between target framework and supported contracts is removed. Instead, each contract package declares its own support by way of its implementation.</p>
<p>The way this is done is beyond the scope of this post, but you can get a sense of it by looking at the layout of the <code>System.IO.FileSystem</code> package below.<br />
<img src="/wp-content/uploads/2015/06/system.io_.filesystem.png" alt="System.IO.FileSystem package layout" title="System.IO.Filesystem" /></p>
<p>In the package, you can see two assemblies in the <code>ref</code> folder, called design-time façades, one for .NET 4.6 and one for everything else (CoreCLR, .NET Native, etc). The surface area is identical but they function a bit differently. The façades are used at build time to enable portable assemblies which were built against contracts (<code>System.Runtime</code>-based) to actually resolve those types against the desktop reference assemblies (<code>mscorlib</code>-based). This lets an <code>mscorlib</code> assembly pass its version of <code>string</code>, that lives in <code>mscorlib</code>, to an API in a PCL that takes a <code>string</code> from <code>System.Runtime</code>. The same façades are used at runtime as well. This is something that should usually be considered trivia as most people need not concern themselves about the minutia.</p>
<p>The package contains three implementations of the contract, one for <code>dnxcore50</code>, one for <code>net46</code> and one for <code>netcore50</code> (UWP). When I said earlier that the new .NET Core packages would only support the newer platforms, this is the how/what/why. One last thing to note in the above picture, you can see that <code>System.IO.FileSystem</code> itself declares many other dependencies. This is expected; with small, granular, libraries the end result is that you pull in only what you need, not the whole framework.</p>
<p>None of this is to say that <code>dotnet</code> explicitly means the newer platforms though. Microsoft may release the existing contract assemblies, the ones currently in the Profile* directories, as NuGet packages. If they do that, then a library that “targets” <code>dotnet</code> could target .NET 4.5/Win8 as well. The key is that version number of each dependency would be lower than the new ones. The new .NET Core libraries, and their contracts, would all have a higher version number than the existing contracts.</p>
<p>This drives home the point that what <code>dotnet</code> really means is “check my dependencies and I’ll run on any platform my dependencies do.”</p>
<p>The fact that the new .NET Core libraries use this mechanism is actually orthogonal to <code>dotnet</code>’s meaning. <code>dotnet</code> adds its value today with existing code and libraries by changing the question of “what platforms does my library support” to “what dependencies does my library require?”</p>
<p>Coming back to the earlier example of Json.NET, if it were to use <code>dotnet</code>, it would also declare the contracts, with its version, that it needs. It would not have to know or care about what platforms are currently supported by those contracts. In the future, if some new <code>unicorn</code> platform were to appear, so long as newer versions of the contracts were published that supported the <code>unicorn</code> platform, Json.NET would happily run there without any foreknowledge.</p>
<h3 id="contractsordependencies">Contracts or Dependencies?</h3>
<p>Throughout this discussion, I’ve used the terms contracts and dependencies. From the perspective of a library author or consumer, these terms are often interchangeably, but there is a difference. Contracts are one type of dependency – they are specifically crafted reference assemblies. Contracts are useful if you need to have multiple implementations of library for different platforms. Aside from the built-in system reference assemblies, the other place you see contracts are libraries that use the “<a href="http://log.paulbetts.org/the-bait-and-switch-pcl-trick/">bait and switch</a>” PCL technique. The vast majority of libraries can be implemented without any platform-specific references and are thus simply dependencies. If this sounds confusing, don’t worry too much about it. This is an advanced technique that most packages don’t need to consider; the only takeaway is that whether contract or “regular” library, they both appear as dependencies in a package.</p>
<h2 id="wrappingitallup">Wrapping it all up</h2>
<p>At first glance, it’s easy to think “whoa, this is complicated!” Upon stepping back though, hopefully the initial complexity melts away with the newfound understanding that what’s happening here is that a layer is being removed. The layer was the platform. Up until NuGet v3 we were trying to cram a round peg into a square hole. We’d gather up an intersection of target frameworks and call it a profile. We’d calculate the contract assemblies for those and the compiler would reference those, but they stayed firmly in the background. Visual Studio intentionally hides the references behind a single <code>.NET</code> entry in a PCL project’s references. This lead to the platform support list being encoded within the NuGet package structure, leaving package authors scrambling to update their packages should a new platform emerge. In many cases, the existing code is already compatible but a package update was required. NuGet v3 eliminates this problem by removing the platform layer and have the ability to go “direct to the dependencies.” This is an opt-in approach for packages that use the new <code>dotnet</code> TFM. Packages can contain both <code>dotnet</code> and the existing TFMs; they are not mutually exclusive.</p>
<p>The new version of .NET Core is dependent on these dependency-driven, framework agnostic packages, but the existing PCL profiles could fit into the model too. That said, <code>dotnet</code> doesn’t mean .NET Core any more than it means any other platform. They’re different things.</p>
    </div>
</div>
                    
                        <div id="post-2281" class="item post-2281 post type-post status-publish format-standard hentry category-uncategorized tag-dotnet tag-pcl tag-uwp tag-windows-10">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/06/09/pcls-net-core-dnx-and-uwp/" name="2281" rel="bookmark" class="post-title">Demystifying PCL&#8217;s, .NET Core, DNX and UWP</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            June 9, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/dotnet/" rel="tag" class="label label-primary">dotnet</a>, <a href="http://oren.codes/tag/pcl/" rel="tag" class="label label-primary">pcl</a>, <a href="http://oren.codes/tag/uwp/" rel="tag" class="label label-primary">uwp</a>, <a href="http://oren.codes/tag/windows-10/" rel="tag" class="label label-primary">windows 10</a>        </p>
    </div>
    <div class="post-content">
        <p>Since the announcement of <a href="http://blogs.msdn.com/b/dotnet/archive/2014/12/04/introducing-net-core.aspx">.NET Core</a> there&#8217;s been <a href="https://github.com/dotnet/corefx/issues/973">confusion</a> around what that means for <a href="https://msdn.microsoft.com/en-us/library/gg597391.aspx">Portable Class Libraries</a>, runtime support, NuGet support and how these &#8220;new&#8221; libraries relate to the existing PCLs. At least I was confused.</p>
<p>As ASPNet 5 started taking shape, we started hearing about new target frameworks for NuGet, like <code>dnxcore50</code>. Other posts mentioned that the new Windows 10 Universal Windows Platform (UWP) would be using the new .NET Core 5 libraries too, but that lead to the question, what do we call it in NuGet? <code>dnxcore5</code> is clearly the wrong one as that refers to the Dotnet Runtime Environment.</p>
<p>Current NuGet conventions don&#8217;t make things any more clear. Today we have the following target framework names:</p>
<ul>
<li><strong>Win</strong> Windows 8 and Windows 8.1 </li>
<li><strong>Net</strong> .NET Framework</li>
<li><strong>Wpa</strong> Windows Phone App 8.1</li>
<li><strong>NetCore</strong> Also refers to Windows 8 and 8.1
<ul>
<li>NetCore and Win are used interchangeably and are the same</li>
</ul>
</li>
</ul>
<p>So far, NuGet has added the following over the course of ASPNet vNext:</p>
<ul>
<li><strong>dnx</strong> The Dotnet Runtime Environment for the .NET Framework</li>
<li><strong>dnxcore</strong> The Dotnet Runtime Environment for the .NET Core CLR</li>
</ul>
<p>Over the past few days, it seems like the .NET Core team has been busy <a href="https://github.com/aspnet/DependencyInjection/pull/245">updating</a> the target names to change from <code>dnxcore5</code> to something new called <code>dotnet</code>. More confusion to ensue.</p>
<p><a href="https://twitter.com/bricelambs">Brice Lambson</a> was kind enough to explain it this afternoon and it finally all makes sense, so here is (don&#8217;t take this as official advice!) my current understanding. The new world distinguishes between the platform (.NET Framework/CoreCLR) and the app model (desktop/aspnet/UWP) cleanly.</p>
<ul>
<li><strong>dotnet</strong> This is the new .NET Core for packages that don&#8217;t have any app model requirements.</li>
<li><strong>net</strong> Existing .NET Framework platform</li>
<li><strong>netcore</strong> For UWP apps, based on <code>dotnet</code> plus app model specifics</li>
<li><strong>dnx</strong> ASPNet apps based on the .NET Framework</li>
<li><strong>dnxcore</strong> ASPNet apps based on the .NET Core framework</li>
</ul>
<p>These are the targets you&#8217;ll most likely care about going forward. Most libraries will want to target <code>dotnet</code> to hit the widest range of consuming apps. <code>dotnet</code> will run on the .NET 4.6 Framework. If you need specific UWP functionality (like XAML in your library), then you&#8217;ll need <code>netcore5</code>. If you need AspNet specific items, then you&#8217;ll need <code>dnxcore5</code>. If you need something that&#8217;s only part of the full .NET Framework, then you&#8217;ll need either <code>net46</code> or <code>dnx46</code>.</p>
<p>This ties into the existing PCL structure by being a new platform. Today you have libraries that support multiple platforms like this <code>portable-net45+netcore45+wpa81</code>. If you want to also include <code>dotnet</code>, then it simply becomes <code>portable-net45+netcore45+wpa81+dotnet</code>. If you can afford to target just Windows 10, .NET 4.6 and ASPNet 5, then having the older platforms severely limits your available surface area. In that case, better to target just <code>dotnet</code>, which can then be consumed by all of the modern platforms.</p>
<h3 id="whatdoesthisallmean">What does this all mean?</h3>
<p>The table below should help explain things. The columns represent target frameworks and the rows are platforms/apps. That is, if your library targets <em>x</em> it&#8217;ll run on <em>y</em>.<br />
<img src="/wp-content/uploads/2015/06/netcompatchart.png" alt="" title="" /></p>
    </div>
</div>
                    
                        <div id="post-2191" class="item post-2191 post type-post status-publish format-standard hentry category-uncategorized tag-wp8 tag-xamarin tag-xunit">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/03/16/xunit-for-xamarin-is-dead-long-live-xunit-for-devices/" name="2191" rel="bookmark" class="post-title">xUnit for Xamarin is dead, long live xUnit for Devices!</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            March 16, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/wp8/" rel="tag" class="label label-primary">wp8</a>, <a href="http://oren.codes/tag/xamarin/" rel="tag" class="label label-primary">Xamarin</a>, <a href="http://oren.codes/tag/xunit/" rel="tag" class="label label-primary">xUnit</a>        </p>
    </div>
    <div class="post-content">
        <h1>xUnit for Xamarin is dead, long live xUnit for Devices!</h1>
<p>In conjunction with today&#8217;s release of <a href="http://xunit.github.io/release-notes/2015-03-16.html">xUnit 2.0 RTM</a>, I&#8217;m happy to announce the initial release of xUnit for Devices (<a href="https://github.com/xunit/devices.xunit">GitHub</a> | <a href="https://www.nuget.org/packages/xunit.runner.devices">NuGet</a>). This has been a long time coming and I&#8217;d like to thank <a href="https://twitter.com/bradwilson">Brad Wilson</a> and <a href="https://twitter.com/jamesnewkirk">James Newkirk</a> for their tremendous efforts over the years.</p>
<h3>Project rename</h3>
<p>xUnit for Devices started out as xUnit for Xamarin. Over the course of development however, it became apparent that what we really have is an MVVM-based test runner where the view was only an implementation detail. Current support is limited to platforms <a href="http://xamarin.com/forms">Xamarin Forms</a> supports, but in the future it&#8217;s pretty easy to add a desktop/WPF view and support any additional GUI platform as needed.</p>
<h3>Upgrading your projects to RTM</h3>
<p>If you&#8217;ve been using xUnit for Xamarin, the easiest way to update is by using NuGet. There&#8217;s a final <code>xunit.runner.xamarin</code> package that pulls in the new <code>xunit.runner.devices</code> package. After upgrading, you can simply remove the old package and keep the dependencies. Windows Phone 8 users will need to make one additional change in the MainPage.xaml to update the assemly name from <code>xunit.runner.xamarin</code> to <code>xunit.runner.devices</code>.</p>
<h3>Getting Started</h3>
<p>The RTM 1.0 release is available on <a href="https://www.nuget.org/packages/xunit.runner.devices">NuGet</a> and on <a href="https://github.com/xunit/devices.xunit">GitHub</a>.</p>
<p>For iOS and Android, create a new blank Xamarin app project to host the unit test runner. Make sure to give any capabilities/permissions you need in the appropriate manifest.</p>
<p>For WP8, create a new Unit Test Project and then remove the <code>MSTestFramework</code> reference.</p>
<p>Then for all platforms, install/update the <code>xunit.runner.devices</code> package via the GUI or <code>Package Manager Console</code>:<br />
<code>Install-Package xunit.runner.devices</code></p>
<p>Then look for the <code>.cs.txt</code>, <code>xaml.txt</code> files that are the templates for your platform and copy/paste the contents into the app. Specifically,<br />
&#8211; iOS: replace the contents of <code>AppDelegate.cs</code> with <code>AppDelegate.cs.txt</code><br />
&#8211; Android: replace the contents of <code>MainActivity.cs</code> with <code>MainActivity.cs.txt</code><br />
&#8211; WP8: replace the contents of <code>MainPage.xaml.cs</code> with <code>MainPage.xaml.cs.txt</code> <em>and</em> <code>MainPage.xaml</code> with <code>MainPage.xaml.txt</code></p>
    </div>
</div>
                    
                        <div id="post-2141" class="item post-2141 post type-post status-publish format-standard hentry category-uncategorized tag-wp8 tag-xamarin tag-xunit">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/02/23/xunit-device-runners-1-0-rc3/" name="2141" rel="bookmark" class="post-title">xUnit Device Runners 1.0 RC3</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            February 23, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/wp8/" rel="tag" class="label label-primary">wp8</a>, <a href="http://oren.codes/tag/xamarin/" rel="tag" class="label label-primary">Xamarin</a>, <a href="http://oren.codes/tag/xunit/" rel="tag" class="label label-primary">xUnit</a>        </p>
    </div>
    <div class="post-content">
        <p>Following the release of <a href="http://xunit.github.io/release-notes/2015-02-23.html">xUnit 2.0 RC3</a>, the Xamarin Device Runners have been updated to work with RC3. </p>
<p>One note for Android users: due to a dependence on Xamarin Forms, your runner app project needs to use API level 21 as its target and SDK. You can target down to API level 15 if you wish. You can also reference other MonoAndroid or Portable Class Libraries if you want to keep your unit tests at a different API level. You also might need to specify a default theme on some devices to workaround a different Xamarin Forms bug. Please see the updated <code>MainActivity.cs.txt</code> for the specifics.</p>
<h3 id="waitwhathappenedtorc2">Wait, what happened to RC2?</h3>
<p>If you blinked, you missed it. RC2 of the Device Runners came out Saturday. With xUnit RC3 being a quick update from RC2, it&#8217;s best to skip to the latest.</p>
<p>As always, if you run into any issues, feel free to reach out to <a href="https://twitter.com/onovotny">@onovotny</a> on Twitter or post an <a href="https://github.com/xunit/xamarin.xunit/issues">issue on GitHub</a>.</p>
<h3 id="gettingstarted">Getting Started</h3>
<p>RC3 is available on <a href="https://www.nuget.org/packages/xunit.runner.xamarin">NuGet</a> and on <a href="https://github.com/xunit/xamarin.xunit">GitHub</a>.</p>
<p>For iOS and Android, create a new blank Xamarin app project to host the unit test runner. Make sure to give any capabilities/permissions you need in the appropriate manifest. </p>
<p>For WP8, create a new Unit Test Project and then remove the MSTestFramework reference.</p>
<p>Then for all platforms, install/update the <code>xUnit.Runner.Xamarin</code> package via the GUI or <code>Package Manager Console</code>:<br />
<code>Install-Package xunit.runner.xamarin -Pre</code></p>
<p>Then look for the <code>.cs.txt</code>, <code>xaml.txt</code> files that are the templates for your platform and copy/paste the contents into the app. Specifically,<br />
&#8211; iOS: replace the contents of <code>AppDelegate.cs</code> with <code>AppDelegate.cs.txt</code><br />
&#8211; Android: replace the contents of <code>MainActivity.cs</code> with <code>MainActivity.cs.txt</code><br />
&#8211; WP8: replace the contents of <code>MainPage.xaml.cs</code> with <code>MainPage.xaml.cs.txt</code> <em>and</em> <code>MainPage.xaml</code> with <code>MainPage.xaml.txt</code></p>
    </div>
</div>
                    
                        <div id="post-2051" class="item post-2051 post type-post status-publish format-standard hentry category-uncategorized tag-android tag-ios tag-windows-phone tag-xamarin tag-xunit">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/01/31/announcing-xunit-device-runner-rc1/" name="2051" rel="bookmark" class="post-title">Announcing: xUnit Device Runner RC1</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            January 31, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/android/" rel="tag" class="label label-primary">Android</a>, <a href="http://oren.codes/tag/ios/" rel="tag" class="label label-primary">iOS</a>, <a href="http://oren.codes/tag/windows-phone/" rel="tag" class="label label-primary">windows phone</a>, <a href="http://oren.codes/tag/xamarin/" rel="tag" class="label label-primary">Xamarin</a>, <a href="http://oren.codes/tag/xunit/" rel="tag" class="label label-primary">xUnit</a>        </p>
    </div>
    <div class="post-content">
        <h1 id="xunitdevicerunner10rc1">xUnit Device Runner 1.0 RC1</h1>
<p>I&#8217;m pleased to announce the release of the <a href="https://www.nuget.org/packages/xunit.runner.xamarin/">xUnit Device Runners Release Candidate 1</a>. This release adds support for the Xamarin.iOS Unified profile, required for all new iOS applications now and updates starting in July.</p>
<p>Other notable enhancements include a filter for searching test cases by name and status (pass/fail/not run).</p>
<p>To get started, please see the following posts:</p>
<ul>
<li><a href="//blog.novotny.org/2014/07/10/getting-started-with-xunit-for-xamarin/">iOS and Android</a></li>
<li><a href="//blog.novotny.org/2014/11/21/now-available-xunit-for-windows-phone-8-silverlight/">Windows Phone 8 Silverlight</a></li>
</ul>
<p>If you run into any issues, please file a report in the <a href="https://github.com/xunit/xamarin.xunit/issues">issue tracker</a>.</p>
    </div>
</div>
                    
                        <div id="post-1931" class="item post-1931 post type-post status-publish format-standard hentry category-uncategorized tag-xamarin">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2015/01/12/xamarin-3-9-is-stable-update-now/" name="1931" rel="bookmark" class="post-title">Xamarin 3.9 is Stable: Update Now</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            January 12, 2015
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/xamarin/" rel="tag" class="label label-primary">Xamarin</a>        </p>
    </div>
    <div class="post-content">
        <p>Xamarin just pushed 3.9 to the stable channel. I’d recommend everyone doing Xamarin work update to this. The most important updates are:</p>
<ol>
<li>Support for creating 64-bit iOS apps. This uses the new &#8220;Xamarin.iOS Unified&#8221; profile. The existing profile has been deprecated but will remain for legacy enterprise-only apps. As of Feb 1, Apple will require new apps to be 64-bit and as of June 1, updates to existing apps must be 64-bit.
<ul>
<li><a href="http://blog.xamarin.com/xamarin.ios-unified-api-with-64-bit-support/">http://blog.xamarin.com/xamarin.ios-unified-api-with-64-bit-support/</a></li>
<li><a href="https://developer.apple.com/news/?id=12172014b">https://developer.apple.com/news/?id=12172014b</a></li>
<li>See <a href="http://developer.xamarin.com/guides/cross-platform/macios/updating-apps/">this guide</a> for how to migrate existing iOS apps to the new framework. In most cases it’s just running the migrate tool and removing  <code>MonoTouch</code> from using statements. </li>
</ul>
</li>
<li>Support for Visual Studio 2015 Preview. For those of you using the VS 2015 preview, Xamarin 3.9 supports it.</li>
<li>Visual Studio Android Emulator support. The VS Android emulator uses Hyper-V, so it’s fast and also works if you had to enable HyperV for any other reason and thus can’t use Genymotion or other ring 0-based virtualization.</li>
</ol>
    </div>
</div>
                    
                        <div id="post-1761" class="item post-1761 post type-post status-publish format-standard hentry category-uncategorized tag-forms tag-xamarin tag-xaml">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2014/12/31/datatemplateselector-for-xamarin-forms/" name="1761" rel="bookmark" class="post-title">DataTemplateSelector for Xamarin.Forms</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            December 31, 2014
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/forms/" rel="tag" class="label label-primary">Forms</a>, <a href="http://oren.codes/tag/xamarin/" rel="tag" class="label label-primary">Xamarin</a>, <a href="http://oren.codes/tag/xaml/" rel="tag" class="label label-primary">XAML</a>        </p>
    </div>
    <div class="post-content">
        <p>Next up in the saga of Xamarin Forms: <code>DataTemplateSelector</code>&#8216;s.</p>
<p>For people coming into Xamarin Forms from Microsoft XAML, it&#8217;s easy to see many gaps. Xamarin Forms is still young, but there are some workarounds. I&#8217;ve already blogged about how to implement a <a href="//blog.novotny.org/2014/12/31/contentpresenter-for-xamarin-forms/">ContentPresenter</a>, next up is the <code>DataTemplateSelector</code>.</p>
<p>Supposed you want to put a list of items into a <code>ListView</code> but use a different <code>DataTemplate</code> for some of the items? In Microsoft XAML, you could set the <code>ItemTemplateSelector</code> property to a custom <code>DataTemplateSelector</code> and you&#8217;d be all set. Sadly, this is not yet available within Xamarin Forms, but we can create our own.</p>
<p>To see the specific usage/examples of how to implement a custom <code>DataTemplateSelector</code> instance, please refer to <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datatemplateselector(v=vs.110).aspx">MSDN</a> or your favorite search engine. Usage will be exactly the same*</p>
<p>There are a few classes we&#8217;ll need:</p>
<ol>
<li>DataTemplateSelector.cs
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>public class DataTemplateSelector
{
    public virtual DataTemplate SelectTemplate(object item, BindableObject container)
    {
        return null;
    }
}
</code></pre></div>
</li>
<li>ExtendedlistView.cs
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>public class ExtendedListView : ListView
{
    public static readonly BindableProperty ItemTemplateSelectorProperty = BindableProperty.Create("ItemTemplateSelector", typeof(DataTemplateSelector), typeof(ExtendedListView), null, propertyChanged: OnDataTemplateSelectorChanged);
    private DataTemplateSelector currentItemSelector;
    private static void OnDataTemplateSelectorChanged(BindableObject bindable, object oldvalue, object newvalue)
    {
        ((ExtendedListView)bindable).OnDataTemplateSelectorChanged((DataTemplateSelector)oldvalue, (DataTemplateSelector)newvalue);
    }            
    protected virtual void OnDataTemplateSelectorChanged(DataTemplateSelector oldValue, DataTemplateSelector newValue)
    {
        // check to see we don't have an ItemTemplate set
        if (ItemTemplate != null &amp;&amp; newValue != null)
            throw new ArgumentException("Cannot set both ItemTemplate and ItemTemplateSelector", "ItemTemplateSelector");
        currentItemSelector = newValue;
    }
    protected override Cell CreateDefault(object item)
    {
        if (currentItemSelector != null)
        {
            var template = currentItemSelector.SelectTemplate(item, this);
            if (template != null)
            {
                var templateInstance = template.CreateContent();
                // see if it's a view or a cell
                var templateView = templateInstance as View;
                var templateCell = templateInstance as Cell;
                if (templateView == null &amp;&amp; templateCell == null)
                    throw new InvalidOperationException("DataTemplate must be either a Cell or a View");
                if (templateView != null) // we got a view, wrap in a cell
                    templateCell = new ViewCell { View = templateView };
                return templateCell;
            }
        }
        return base.CreateDefault(item);
    }
    public DataTemplateSelector ItemTemplateSelector
    {
        get
        {
            return (DataTemplateSelector)GetValue(ItemTemplateSelectorProperty);
        }
        set
        {
            SetValue(ItemTemplateSelectorProperty, value);
        }
    }
}
</code></pre></div>
</li>
</ol>
<p>With these two pieces, you can now create your own selector. Suppose you have an RSS Feed that you want to display an alternate template every 4 items. For this example, we&#8217;ll assume that each item in the list has an index attached.</p>
<p>We&#8217;ll start with our custom selector:</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>public class NewsItemTemplateSelector : DataTemplateSelector
{
    public DataTemplate NewsItem { get; set; }
    public DataTemplate NewsItemLarge { get; set; }

    public override DataTemplate SelectTemplate(object item, BindableObject container)
    {
        // must have IListItems
        var li = (IListItem)item;

        if (li.Index == 0 || li.Index%4 == 0)
        {
            return NewsItemLarge;
        }
        return NewsItem;
    }
}
</code></pre></div>
<p>Now in the App.xaml, lets add our templates. (Aside: See <a href="https://github.com/petermajor/Xamarin.Forms.SharedResourceDictionary">this example</a> for how to use XAML for your App class allowing you to easily use XAML shared resources.)</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>  &lt;DataTemplate x:Key="NewsItem"&gt;
    &lt;Grid MinimumHeightRequest="320"&gt;
      &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height="120"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition Width="140"/&gt;
        &lt;ColumnDefinition Width="*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Image Grid.Row="0" Grid.Column="0" Source="{Binding ImageUrl}" HeightRequest="110" Aspect="AspectFill" VerticalOptions="Start" /&gt;
      &lt;StackLayout Grid.Row="0" Grid.Column="1" Padding="16, 0, 10, 8"&gt;
        &lt;Label Grid.Row="0" Grid.ColumnSpan="2" VerticalOptions="Center" Text="{Binding Title}" /&gt;
        &lt;ContentView HeightRequest="4" /&gt;&lt;!-- Hack for margin --&gt;
        &lt;Label Grid.Row="1" Grid.Column="1" VerticalOptions="Start" Text="{Binding Summary}" /&gt;
      &lt;/StackLayout&gt;
    &lt;/Grid&gt;
  &lt;/DataTemplate&gt;

  &lt;DataTemplate x:Key="NewsItemLarge"&gt;
    &lt;Grid MinimumHeightRequest="520"&gt;
      &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height="Auto"/&gt;
        &lt;RowDefinition Height="120" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Image Grid.Row="0" Source="{Binding ImageUrl}" HeightRequest="400" Aspect="AspectFill" VerticalOptions="Start" /&gt;
      &lt;StackLayout Grid.Row="1" Padding="16, 0, 10, 8"&gt;
        &lt;Label Grid.Row="0" Grid.ColumnSpan="2" VerticalOptions="Center" Text="{Binding Title}" /&gt;
        &lt;ContentView HeightRequest="4" /&gt;
        &lt;!-- Hack for margin --&gt;
        &lt;Label Grid.Row="1" Grid.Column="1" Style="{StaticResource ItemSubheaderText}" VerticalOptions="Start" Text="{Binding Summary}" /&gt;
      &lt;/StackLayout&gt;
    &lt;/Grid&gt;
  &lt;/DataTemplate&gt; 
</code></pre></div>
<p>Here&#8217;s the custom <code>DataTemplateSelector</code>:</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>public class NewsItemTemplateSelector : DataTemplateSelector
{
    public DataTemplate NewsItem { get; set; }
    public DataTemplate NewsItemLarge { get; set; }

    public override DataTemplate SelectTemplate(object item, BindableObject container)
    {
        // must have IListItems
        var li = (IListItem)item;

        if (li.Index == 0 || li.Index%4 == 0)
        {
            return NewsItemLarge;
        }
        return NewsItem;
    }
}
</code></pre></div>
<p>Finally, we&#8217;ll add an instance of the <code>DataTemplateSelector</code> to the App.xaml:</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>  &lt;controls:NewsItemTemplateSelector x:Key="NewsItemTemplateSelector"                                         NewsItem="{StaticResource NewsItem}"                                         NewsItemLarge="{StaticResource NewsItemLarge}" /&gt;
</code></pre></div>
<p>Later on, when we want to use it, we can use it with our <code>ExtendedListView</code>:</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>&lt;controls:ExtendedListView ItemsSource="{Binding Items}"              ItemTemplateSelector="{StaticResource NewsItemTemplateSelector}"&gt;
&lt;/controls:ExtendedListView&gt;
</code></pre></div>
<p>When rendered, the first item will have the large image template and then every fourth item will too.</p>
<p>BONUS: You can use either <code>View</code> or <code>Cell</code>-derived types in your DataTemplates as the control will automatically wrap Views into a ViewCell.</p>
<p>Enjoy!</p>
<p>*probably.</p>
    </div>
</div>
                    
                        <div id="post-1721" class="item post-1721 post type-post status-publish format-standard hentry category-uncategorized tag-forms tag-xamarin tag-xaml">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2014/12/31/contentpresenter-for-xamarin-forms/" name="1721" rel="bookmark" class="post-title">ContentPresenter for Xamarin.Forms</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            December 31, 2014
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/forms/" rel="tag" class="label label-primary">Forms</a>, <a href="http://oren.codes/tag/xamarin/" rel="tag" class="label label-primary">Xamarin</a>, <a href="http://oren.codes/tag/xaml/" rel="tag" class="label label-primary">XAML</a>        </p>
    </div>
    <div class="post-content">
        <p>While working on a new Xamarin Forms project, I came across the need for a <code>ContentPresenter</code> ala Microsoft XAML. The basic idea is to use a placeholder for a piece of content (usually a ViewModel) and then supply a <code>DataTemplate</code> to control how it should be displayed. </p>
<p>A simple example might look like this:</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>&lt;Grid&gt;
  &lt;Grid.RowDefinitions&gt;
    &lt;RowDefinition Height="Auto" /&gt;
    &lt;RowDefinition Height="*" /&gt;
  &lt;/Grid.RowDefinitions&gt;
  &lt;controls:ContentPresenter Grid.Row="1"
               BindingContext="{Binding MyModel, Source={StaticResource Locator}}" 
               ItemTemplate="{StaticResource MyModelTemplate}"
               /&gt;

&lt;/Grid&gt;
</code></pre></div>
<p>This goes back to some of the more &#8220;classic&#8221; MVVM patterns where we want to make our display more componentized. </p>
<p>In Xamarin Forms Today (v1.3.0), if you want to create a custom component, you can derive from ContentView and go to town. Add your widgets either with XAML or in code. Many times though, we don&#8217;t really need to create a new class/view directly. A <code>DataTemplate</code> is sufficient as we can bind to the ViewModel and use Commands to take action. These are the so-called &#8220;zero code-behind&#8221; views.</p>
<p>In this case, a ContentPresenter is all we need &#8211; set the <code>BindingContext</code> to your ViewModel and create/bind a DataTemplate. New to Forms 1.3, you can now put resources in the Application-level, so you can more easily share those instances.</p>
<p>Here&#8217;s the complete code, sans-usings, to implement your own. This can go either in a Shared code or PCL:</p>
<div class="code-box"><div class="code-title"><i class="fa fa-code"></i> <div class="pull-right"><a href="#" class="btn btn-default btn-xs toggle-code" data-toggle="tooltip" title="Toggle code"><i class="fa fa-toggle-up"></i></a></div></div><pre ><code>public class ContentPresenter : ContentView
{
    public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create("ItemTemplate", typeof(DataTemplate), typeof(ContentPresenter), null, propertyChanged: OnItemTemplateChanged);

    private static void OnItemTemplateChanged(BindableObject bindable, object oldvalue, object newvalue)
    {
        var cp = (ContentPresenter)bindable; 

        var template = cp.ItemTemplate;
        if (template != null)
        {
            var content = (View)template.CreateContent();
            cp.Content = content;
        }
        else
        {
            cp.Content = null;
        }
    }

    public DataTemplate ItemTemplate
    {
        get
        {
            return (DataTemplate)GetValue(ItemTemplateProperty);
        }
        set
        {
            SetValue(ItemTemplateProperty, value);
        }
    }
}
</code></pre></div>
<p>If you want, you can get fancy with Triggers and change the <code>ItemTemplate</code> to vary based on whatever conditions you want.</p>
    </div>
</div>
                    
                        <div id="post-1491" class="item post-1491 post type-post status-publish format-standard hentry category-uncategorized tag-windows-phone tag-xunit">
    <h2 style="margin-top: 0;">
        <a href="http://oren.codes/2014/11/21/now-available-xunit-for-windows-phone-8-silverlight/" name="1491" rel="bookmark" class="post-title">Now available: xUnit for Windows Phone 8 Silverlight</a>
    </h2>
    <div name="meta">
        <p class="text-muted">
            <i class="fa fa-calendar"></i>
            November 21, 2014
            <i class="fa fa-folder-open" style="margin-left: 20px;"></i> 
            <a href="http://oren.codes/category/uncategorized/" rel="category tag">Uncategorized</a>
            
            <i class="fa fa-tags" style="margin-left: 20px;"></i> <a href="http://oren.codes/tag/windows-phone/" rel="tag" class="label label-primary">windows phone</a>, <a href="http://oren.codes/tag/xunit/" rel="tag" class="label label-primary">xUnit</a>        </p>
    </div>
    <div class="post-content">
        <p>With the release of <a href="http://xunit.github.io/release-notes/2014-11-19.html">xUnit 2 beta 5</a>,  Windows Phone 8 Siverlight is now supported; here&#8217;s how to get started.</p>
<blockquote><p>
  Side note: If you&#8217;ve previously had the xUnit Extension VSIX installed, you need to remove it for beta 5. You no longer need it. See the <a href="http://xunit.github.io/release-notes/2014-11-19.html">release notes</a> for details.
</p></blockquote>
<p>Unfortunatey, due to limitations in the Visual Studio Test Explorer&#8217;s architecture, we can&#8217;t yet integrate into the Test Explorer window like we can for Universal or Dekstop apps. Instead, we have to run the unit tests as an app on the device, exactly like we do for Xamarin. In fact, with Xamarin Forms providing the UI, we&#8217;re able to bring the same runner support to WP8.</p>
<h4 id="stepstocreateawindowsphone8silverlighttestproject">Steps to create a Windows Phone 8 Silverlight test project</h4>
<ol>
<li>Read <a href="http://blog.novotny.org/2014/07/10/getting-started-with-xunit-for-xamarin/">the post</a> on getting started with Xamarin. It&#8217;s almost identical.</li>
<li>Use the latest version of the runner, <code>0.99.5-beta5</code> at the time of this writing.</li>
<li>When creating the WP8 App, use the <code>Windows Phone 8 Silverlight (Blank)</code> template.</li>
<li>Replace the contents of <code>MainPage.xaml.cs</code> with the contents of <code>MainPage.xaml.cs.txt</code> added to your project</li>
</ol>
<p>To run tests, simply run the app either in the debugger or deploy and run.</p>
<h4 id="knownissues">Known issues</h4>
<p>The Xamarin Forms-based runner is bare bones. It needs a lot of work to add features. But it does work to execute xUnit tests and run them in a debugger to figure out why stuff&#8217;s not working <img src="http://oren.codes/wp-includes/images/smilies/simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h4 id="howyoucanhelp">How you can help</h4>
<p>Pull requests are very much welcome over at the <a href="https://github.com/xunit/xamarin.xunit/">project site</a>. If you need help getting up-and-running, just ping <a href="https://twitter.com/onovotny/">me</a> on Twitter.</p>
    </div>
</div>
                    
                                
                                <ul class="pager">
                    <li class="previous"><a href="http://oren.codes/page/2/" >Older posts</a></li>
                    <li class="next"></li>
                </ul>
            </div>
            <div class="col-md-2">
                <div class="sidebar">
    <div id="image-2" class="widget hidden-xs"><div class="jetpack-image-container"><a href="http://blog.novotny.org/about/"><img src="http://i1.wp.com/blog.novotny.org/wp-content/uploads/2014/07/headshot-new.jpg" alt="Oren Novotny" class="alignnone" width="180" height="252" /></a></div>
</div><div id="image-3" class="widget hidden-xs"><div class="jetpack-image-container"><a href="https://mvp.microsoft.com/en-us/mvp/Oren%20Novotny-5000913"><img src="http://i1.wp.com/blog.novotny.org/wp-content/uploads/2014/07/MVP_Logo.gif" alt="Microsoft MVP" class="alignleft" width="180" height="73" /></a></div>
</div>		<div id="recent-posts-2" class="widget hidden-xs">		<h2 class="widgettitle">Recent Posts</h2>
		<ul>
					<li>
				<a href="http://oren.codes/2015/07/29/targeting-net-core/">Targeting .NET Core</a>
						</li>
					<li>
				<a href="http://oren.codes/2015/06/16/demystifying-pcls-net-core-dnx-and-uwp-redux/">Demystifying PCLs, .NET Core, DNX and UWP (Redux)</a>
						</li>
					<li>
				<a href="http://oren.codes/2015/06/09/pcls-net-core-dnx-and-uwp/">Demystifying PCL&#8217;s, .NET Core, DNX and UWP</a>
						</li>
					<li>
				<a href="http://oren.codes/2015/03/16/xunit-for-xamarin-is-dead-long-live-xunit-for-devices/">xUnit for Xamarin is dead, long live xUnit for Devices!</a>
						</li>
					<li>
				<a href="http://oren.codes/2015/02/23/xunit-device-runners-1-0-rc3/">xUnit Device Runners 1.0 RC3</a>
						</li>
				</ul>
		</div><div id="archives-2" class="widget hidden-xs"><h2 class="widgettitle">Archives</h2>
		<ul>
	<li><a href='http://oren.codes/2015/07/'>July 2015</a></li>
	<li><a href='http://oren.codes/2015/06/'>June 2015</a></li>
	<li><a href='http://oren.codes/2015/03/'>March 2015</a></li>
	<li><a href='http://oren.codes/2015/02/'>February 2015</a></li>
	<li><a href='http://oren.codes/2015/01/'>January 2015</a></li>
	<li><a href='http://oren.codes/2014/12/'>December 2014</a></li>
	<li><a href='http://oren.codes/2014/11/'>November 2014</a></li>
	<li><a href='http://oren.codes/2014/09/'>September 2014</a></li>
	<li><a href='http://oren.codes/2014/08/'>August 2014</a></li>
	<li><a href='http://oren.codes/2014/07/'>July 2014</a></li>
	<li><a href='http://oren.codes/2012/10/'>October 2012</a></li>
	<li><a href='http://oren.codes/2012/07/'>July 2012</a></li>
	<li><a href='http://oren.codes/2012/03/'>March 2012</a></li>
		</ul>
</div><div id="tag_cloud-2" class="widget hidden-xs"><h2 class="widgettitle">Tags</h2>
<div class="tagcloud"><a href='http://oren.codes/tag/net45/' class='tag-link-41' title='1 topic' style='font-size: 8pt;'>.Net45</a>
<a href='http://oren.codes/tag/net-core/' class='tag-link-261' title='1 topic' style='font-size: 8pt;'>.net core</a>
<a href='http://oren.codes/tag/android/' class='tag-link-131' title='3 topics' style='font-size: 13.675675675676pt;'>Android</a>
<a href='http://oren.codes/tag/asp-net/' class='tag-link-151' title='1 topic' style='font-size: 8pt;'>asp.net</a>
<a href='http://oren.codes/tag/authentication/' class='tag-link-161' title='1 topic' style='font-size: 8pt;'>authentication</a>
<a href='http://oren.codes/tag/c/' class='tag-link-71' title='2 topics' style='font-size: 11.405405405405pt;'>C#</a>
<a href='http://oren.codes/tag/coreclr/' class='tag-link-271' title='1 topic' style='font-size: 8pt;'>coreclr</a>
<a href='http://oren.codes/tag/dotnet/' class='tag-link-231' title='3 topics' style='font-size: 13.675675675676pt;'>dotnet</a>
<a href='http://oren.codes/tag/fluent-assertions/' class='tag-link-141' title='1 topic' style='font-size: 8pt;'>fluent assertions</a>
<a href='http://oren.codes/tag/forms/' class='tag-link-191' title='2 topics' style='font-size: 11.405405405405pt;'>Forms</a>
<a href='http://oren.codes/tag/ios/' class='tag-link-121' title='3 topics' style='font-size: 13.675675675676pt;'>iOS</a>
<a href='http://oren.codes/tag/ninject/' class='tag-link-171' title='1 topic' style='font-size: 8pt;'>ninject</a>
<a href='http://oren.codes/tag/pcl/' class='tag-link-221' title='2 topics' style='font-size: 11.405405405405pt;'>pcl</a>
<a href='http://oren.codes/tag/reflection/' class='tag-link-51' title='1 topic' style='font-size: 8pt;'>Reflection</a>
<a href='http://oren.codes/tag/uwp/' class='tag-link-251' title='3 topics' style='font-size: 13.675675675676pt;'>uwp</a>
<a href='http://oren.codes/tag/vs2012/' class='tag-link-31' title='1 topic' style='font-size: 8pt;'>VS2012</a>
<a href='http://oren.codes/tag/win8/' class='tag-link-21' title='1 topic' style='font-size: 8pt;'>Win8</a>
<a href='http://oren.codes/tag/windows-8/' class='tag-link-81' title='4 topics' style='font-size: 15.567567567568pt;'>Windows 8</a>
<a href='http://oren.codes/tag/windows-10/' class='tag-link-241' title='3 topics' style='font-size: 13.675675675676pt;'>windows 10</a>
<a href='http://oren.codes/tag/windows-phone/' class='tag-link-181' title='3 topics' style='font-size: 13.675675675676pt;'>windows phone</a>
<a href='http://oren.codes/tag/windows-store/' class='tag-link-61' title='3 topics' style='font-size: 13.675675675676pt;'>Windows Store</a>
<a href='http://oren.codes/tag/winrt/' class='tag-link-91' title='3 topics' style='font-size: 13.675675675676pt;'>WinRT</a>
<a href='http://oren.codes/tag/wp8/' class='tag-link-211' title='2 topics' style='font-size: 11.405405405405pt;'>wp8</a>
<a href='http://oren.codes/tag/xamarin/' class='tag-link-111' title='10 topics' style='font-size: 22pt;'>Xamarin</a>
<a href='http://oren.codes/tag/xaml/' class='tag-link-201' title='2 topics' style='font-size: 11.405405405405pt;'>XAML</a>
<a href='http://oren.codes/tag/xunit/' class='tag-link-11' title='7 topics' style='font-size: 19.351351351351pt;'>xUnit</a></div>
</div></div>            </div>
        </div>

        <footer style="margin-bottom: 20px;">
            <hr>
            <div class="row">
                <div class="col-md-6">
                    <a href="#top" data-scroll="true">
                        <i class="fa fa-arrow-up"></i> Back to top                    </a>
                </div>
                <div class="col-md-6 text-right">
                    <small class="text-muted">
                        &copy <strong>Oren Novotny</strong></strong><br>
                        Theme by <a href="http://nehalist.io" target="_blank">nehalist.io</a>                    </small>
                </div>
            </div>
        </footer>
    </div>
    
    	<div style="display:none">
	</div>
<script type='text/javascript' src='http://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201535'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var mejsL10n = {"language":"en-US","strings":{"Close":"Close","Fullscreen":"Fullscreen","Download File":"Download File","Download Video":"Download Video","Play\/Pause":"Play\/Pause","Mute Toggle":"Mute Toggle","None":"None","Turn off Fullscreen":"Turn off Fullscreen","Go Fullscreen":"Go Fullscreen","Unmute":"Unmute","Mute":"Mute","Captions\/Subtitles":"Captions\/Subtitles"}};
var _wpmejsSettings = {"pluginPath":"\/wp-includes\/js\/mediaelement\/"};
/* ]]> */
</script>
<script type='text/javascript' src='http://oren.codes/wp-includes/js/mediaelement/mediaelement-and-player.min.js?ver=2.16.2'></script>
<script type='text/javascript' src='http://oren.codes/wp-includes/js/mediaelement/wp-mediaelement.js?ver=4.2.4'></script>
<script type='text/javascript' src='http://s.gravatar.com/js/gprofiles.js?ver=2015Augaa'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var WPGroHo = {"my_hash":""};
/* ]]> */
</script>
<script type='text/javascript' src='http://oren.codes/wp-content/plugins/jetpack/modules/wpgroho.js?ver=4.2.4'></script>
<script type='text/javascript' src='http://stats.wp.com/e-201535.js' async defer></script>
<script type='text/javascript'>
	_stq = window._stq || [];
	_stq.push([ 'view', {v:'ext',j:'1:3.6.1',blog:'70680589',post:'0',tz:'-4',srv:'oren.codes'} ]);
	_stq.push([ 'clickTrackerInit', '70680589', '0' ]);
</script>
</body>
</html>
