title: How do you create a unit test assembly for a .NET Portable Class Library?
body: <p>I am attempting to unit test a Portable Class Library that I've created and I want to make sure it's being tested with the same framework subset that it targets.</p>
  
  <p><a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/06/18/visual-studio-2012-rc-what-s-new-in-unit-testing.aspx" rel="noreferrer">Per the Visual Studio ALM + Team Foundation Server blog</a>, the MSTest unit test framework was converted to a PCL in Visual Studio 2012 RC; however, I am unable to create a portable class library and then reference the MSTest framework in VS2012 RTM.</p>
  
  <ul>
  <li>Browsing in the "References" dialog shows me that no unit testing components are registered as compatible with PCL.</li>
  <li>Adding a manual GAC reference in the project file to <code>Microsoft.VisualStudio.QualityTools.UnitTestFramework</code> yields a reference not found build error.</li>
  <li>Adding a manual direct assembly reference to <code>C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v4.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</code> yields a build warning saying the UnitTestFramework assembly references an incompatible <code>mscorlib</code> version.</li>
  </ul>
  
  <p>I did find (thanks to an early answer) that there is a project type <code>Unit Test Library (Windows Store apps)</code> that references a <em>different</em> MSTest assembly at <code>C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSTestFramework\11.0\References\CommonConfiguration\neutral\Microsoft.VisualStudio.TestPlatform.UnitTestFramework.dll</code>. This project type creates a small no-UI Windows Store app... complete with manifest and everything. It also doesn't allow me to specify which frameworks I'm targeting - it appears to be only for Windows Store apps.</p>
  
  <p>Under the <em>potentially faulty</em> assumption that I should be testing my Portable Class Library projects with unit test assemblies that target the same framework subset as the library-under-test...</p>
  
  <p><strong>How do I create a unit test assembly for a .NET Portable Class Library?</strong></p>
  
  <p>(I am open to other frameworks that also target PCL, I'm just currently unaware of other solutions besides MSTest that have taken this into account.)</p>