title: Error loading hostpolicy.dll while deploying .NET Core console app to Azure WebJobs
body: <p>I have followed this <a href="https://blog.kloud.com.au/2016/06/08/azure-webjobs-with-dotnet-core-rc2/" rel="nofollow noreferrer">tutorial</a> to deploy a .NET Core console application to an Azure Web Service WebJob.</p>
  <p>My app is running locally without any issue (with dotnet <strong>1.0.0-preview2-003131</strong>) but when I try to run it from Azure console I have the following error :</p>
  <blockquote>
  <p>Failed to load the dll from <code>[D:\local\VirtualDirectory0\site\wwwroot\app_data\jobs\triggered\PopcornExportWebJob\hostpolicy.dll]</code>, HRESULT: 0x800700C1**</p>
  <p>An error occurred while loading required library hostpolicy.dll from <code>[D:\local\VirtualDirectory0\site\wwwroot\app_data\jobs\triggered\PopcornExportWebJob]</code></p>
  </blockquote>
  <p>The version of Azure .Net is <strong>1.0.0-rc4-004771</strong>  and the hostpolicy.dll file is the same than I use locally. In fact, when I download the zip of my deploy from Azure and when I run it locally, it is working fine. But it fails on Azure environment.</p>
  <p>Also, here is my project.json:</p>
  <pre><code>{
        &quot;publishOptions&quot;: {
          &quot;include&quot;: [
            &quot;run.cmd&quot;
          ]
        },
        &quot;buildOptions&quot;: {
          &quot;emitEntryPoint&quot;: true,
          &quot;copyToOutput&quot;: &quot;appsettings.json&quot;
        },
        &quot;copyright&quot;: &quot;bbougot&quot;,
        &quot;dependencies&quot;: {
          &quot;FubarCoder.RestSharp.Portable.Core&quot;: &quot;4.0.7&quot;,
          &quot;FubarCoder.RestSharp.Portable.HttpClient&quot;: &quot;4.0.7&quot;,
          &quot;Microsoft.ApplicationInsights.AspNetCore&quot;: &quot;2.0.0&quot;,
          &quot;Microsoft.Extensions.Configuration&quot;: &quot;1.1.0&quot;,
          &quot;Microsoft.Extensions.Configuration.Json&quot;: &quot;1.1.0&quot;,
          &quot;Microsoft.Extensions.DependencyInjection&quot;: &quot;1.1.0&quot;,
          &quot;Microsoft.Extensions.Logging&quot;: &quot;1.1.0&quot;,
          &quot;Microsoft.Extensions.Logging.Console&quot;: &quot;1.1.0&quot;,
          &quot;Microsoft.NETCore.App&quot;: &quot;1.1.0&quot;,
          &quot;MongoDB.Driver&quot;: &quot;2.4.2&quot;,
          &quot;StructureMap.Microsoft.DependencyInjection&quot;: &quot;1.3.0&quot;
        },
        &quot;description&quot;: &quot;Popcorn Api Exporter&quot;,
        &quot;frameworks&quot;: {
          &quot;netcoreapp1.1&quot;: {
            &quot;imports&quot;: [
              &quot;portable-net45+win8&quot;
            ]
          }
        },
        &quot;runtimes&quot;: {
          &quot;win10-x64&quot;: {}
        },
        &quot;scripts&quot;: {
          &quot;postpublish&quot;: [ &quot;7za.exe a -tzip PopcornExport.zip .\\bin\\Release\\PublishOutput\\*&quot;, 
                           &quot;.\\WAWSDeploy.exe .\\PopcornExport.zip .\\popcornexport.PublishSettings /t app_data\\jobs\\triggered\\PopcornExportWebJob /v /d&quot; ]
        },
        &quot;title&quot;: &quot;PopcornExport&quot;,
        &quot;version&quot;: &quot;1.0.0-*&quot;
      }
  </code></pre>
  <p>I had to add the node <em>runtimes</em> (win10-x64 otherwise the app can't run locally). But, the Azure Web Service is running on Windows Server 2012. May it be an issue?</p>
  <p>What did I miss?</p>