title: MSBuild Inline Task - Reference non-standard Microsoft assemblies
body: <p>I am using the new MSBuild Inline Task to leverage the TransformXml (XDT Transform) in the <code>Microsoft.Web.Publishing.Tasks.dll</code> assembly.</p>
  
  <p>Here's what my task (snipped) looks like:</p>
  
  <pre><code>&lt;Task&gt;
    &lt;Reference Include="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/&gt;
    &lt;Reference Include="System.Xml" /&gt;
    &lt;Using Namespace="System"/&gt;
    &lt;Using Namespace="System.Linq"/&gt;
    &lt;Using Namespace="System.IO" /&gt;
    &lt;Using Namespace="System.Xml"/&gt;
    &lt;Using Namespace="Microsoft.Web.Publishing.Tasks"/&gt;
    &lt;Code Type="Fragment" Language="cs"&gt;...&lt;/Code&gt;
  &lt;/Task&gt;
  </code></pre>
  
  <p>This compiles fine and the DLL is loaded, however, when executed it fails because it is trying to find the assembly in the appbase path which is: <code>C:\Windows\Microsoft.NET\Framework\v4.0.30319</code>. I would have expected it to look at the path I gave it.</p>
  
  <p>Fusion log shows this:</p>
  
  <pre><code>=== Pre-bind state information ===\r
    LOG: User = xxx\Kamran\r
    LOG: DisplayName = Microsoft.Web.Publishing.Tasks, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
     (Fully-specified)\r
    LOG: Appbase = file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/\r
    LOG: Initial PrivatePath = NULL\r
    Calling assembly : (Unknown).\r
    ===\r
    LOG: This bind starts in default load context.\r
    LOG: Using application configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe.Config\r
    error MSB4018: LOG: Using host configuration file: \r
    error MSB4018: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.\r
    error MSB4018: LOG: Post-policy reference: Microsoft.Web.Publishing.Tasks, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\r
    error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks.DLL.\r
    error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks/Microsoft.Web.Publishing.Tasks.DLL.\r
    error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks.EXE.\r
    error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks/Microsoft.Web.Publishing.Tasks.EXE.\r
  </code></pre>
  
  <p>Is there any way to fix this or will I be forced to create a task assembly instead?</p>