title: dotnet core 1.1.0 and net461 now gets System.IO.FileSystem System.TypeLoadException
body: <p>I have been betting my head on the wall on this.  I keep getting this error on the server 
  <a href="https://i.stack.imgur.com/gcg9a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gcg9a.png" alt="enter image description here"></a> </p>
  
  <blockquote>
    <p>Unhandled Exception: System.TypeLoadException: Could not load type 'System.IO.Di rectory' from assembly 'System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at fais.printing_services.Program.Main(String[] args)</p>
  </blockquote>
  
  <p>I have done ever trick I can think of, followed all the newest issues to resolve with no luck.  Here is my project file:</p>
  
  <pre><code>{
      "userSecretsId": "aspnet-fais.printing_services-6f6dbf21-da98-45d2-a187-08ae49d09d62",
      "dependencies": {
          "DataTables.AspNet.AspNetCore": "2.0.2",
          "Microsoft.ApplicationInsights.AspNetCore": "2.0.0",
          "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
          "Microsoft.AspNetCore.Diagnostics": "1.1.0",
          "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
          "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
          "Microsoft.AspNetCore.Mvc": "1.1.1",
          "Microsoft.AspNetCore.Routing": "1.1.0",
          "Microsoft.AspNet.Session": "1.0.0-*",
          "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
          "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
          "Microsoft.AspNetCore.StaticFiles": "1.1.0",
          "Microsoft.EntityFrameworkCore": "1.1.0",
          "Microsoft.EntityFrameworkCore.Design": "1.1.0",
          "Microsoft.EntityFrameworkCore.Relational.Design": "1.1.0",
          "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
          "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
          "Microsoft.EntityFrameworkCore.Tools": {
              "type": "build",
              "version": "1.1.0-preview4-final"
          },
          "Microsoft.Extensions.Caching.Memory": "1.1.0-*",
          "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
          "Microsoft.Extensions.Configuration.Json": "1.1.0",
          "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
          "Microsoft.Extensions.Logging": "1.1.0",
          "Microsoft.Extensions.Logging.Console": "1.1.0",
          "Microsoft.Extensions.Logging.Debug": "1.1.0",
          "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
          "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
          "Microsoft.VisualStudio.Web.CodeGeneration": "1.1.0-preview4-final",
          "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
          //"Microsoft.VisualStudio.Web.CodeGeneration.Design": "1.1.0-msbuild3-final",
          "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final",
          "Microsoft.AspNetCore.Session": "1.1.0",
          "Microsoft.NETCore": "5.0.1-rc2-24027",
          "Microsoft.NETCore.Portable.Compatibility": "1.0.1-rc2-24027",
          "BundlerMinifier.Core": "2.4.337",
          "Microsoft.AspNetCore.ResponseCompression": "1.0.1",
          "Microsoft.AspNetCore.Cors": "1.1.1",
          "hiqpdf": "10.6.0",
          "Novell.Directory.Ldap.NETStandard": "2.3.6"
      },
      "tools": {
          "Microsoft.EntityFrameworkCore.Tools": {
              "version": "1.1.0-preview4-final",
              "imports": [
                  "portable-net45+win8"
              ]
          },
          "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0.0-preview4-final",
          "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
              "version": "1.1.0-msbuild3-final",
              "imports": [
                  "portable-net45+win8"
              ]
          }
      },
      "frameworks": {
          "net461": {
              "dependencies": {
              },
              "frameworkAssemblies": {
                  "System.Drawing": "4.0.0.0"
              }
          },
          "netcoreapp1.0": {
              "imports": [
                  "dotnet5.6",
                  "portable-net45+win8",
                  "net461"
              ],
              "dependencies": {
                  "Microsoft.NETCore.App": "1.1.0",
                  "CoreCompat.System.Configuration": "4.2.3-r4"
              }
          }
      },
      "buildOptions": {
          "emitEntryPoint": true,
          "preserveCompilationContext": true
      },
      "runtimeOptions": {
          "configProperties": {
              "System.GC.Server": true
          }
      },
      "publishOptions": {
          "include": [
              "wwwroot",
              "**/*.cshtml",
              "appsettings.json",
              "web.config"
          ]
      },
      "runtimes": {
          "win10-x64": {}
      },
      "scripts": {
          "prepublish": [ "bower install", "dotnet bundle" ],
          "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
      }
  }
  </code></pre>
  
  <p>So the reason for <code>.net4.6.1</code> is <code>hiqpdf</code>, it is the only thing that is really the reason i had to load it.  </p>
  
  <p>My app runs on IISExpress, but as soon as i publish it to the IIS box it gets as <code>HTTP Error 502.5 - Process Failure</code>.  I run the exe in the command prompt as Microsoft asks as got what i put up here.  </p>
  
  <p>I keep thinking i just have to move the right item in place and it will work on the server.  What is the difference?  Why does it would great locally but falls on it's face on the server?  Can i include System.IO.FileSystem at a version that will fix this? (which i have tried and failed to).</p>
  
  <p>I know the project.json file needs some clean up again, but it is working in one spot so i figured I would keep it here.</p>
  
  <p><strong>Server Details:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/dWgMs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dWgMs.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/HKSpG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HKSpG.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/c8NZj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c8NZj.png" alt="enter image description here"></a></p>
  
  <p><strong>Other information</strong>
  I figured it would be worth noting thing i have done that wouldn't be known from this:</p>
  
  <ul>
  <li>cleared out the nuget cache from the user path</li>
  <li>cleared the bin</li>
  <li>down graded what i thought i could</li>
  <li>tried to include the <code>System.IO.File</code> directly at v. <code>4.3.0</code> but it downgrades to <code>4.0.0.1</code> I believe.</li>
  </ul>
  
  <p><strong>NOTE:</strong> issue <a href="https://github.com/dotnet/corefx/issues/16913" rel="nofollow noreferrer" title="submitted to repo">submitted to the repo</a> </p>
  
  <h1>Update</h1>
  
  <p>I have been able to wiggle my way into a working solution again.  Great for me, BUT I'm not deleting this off.  The issue stands as my solution was to jump stack to the framework and drop <code>"Novell.Directory.Ldap.NETStandard": "2.3.6"</code> off.  This means my bypass is just so I can make bosses happy that they have their POC, it's not going into production.  I update this so that it sheds light on new areas.</p>