1

I'm playing around with .NET Core and i found myself in a bit of a pickle. I have an app (ASP.NET Core Web Application) which makes a call to search for some files in my Dropbox account. The call is made through a bunch of layers (different .net core class library projects) eventually reaching the final project which has a reference to Dropbox 3.4.1 API which makes the actual call to Dropbox.

The problem is that the bellow exception is thrown. Interesting tho, making the exact same call from a .Net Core Console Application works just fine.

Here is the project.json of the Web Application:

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "System.Runtime.Serialization.Primitives": "4.1.1",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
    "SyncPlayer.Common": "1.0.0-*",
    "SyncPlayer.Domain": "1.0.0-*"
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

The project.json of the Console Application:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0"
    },
    "SyncPlayer.Common": "1.0.0-*",
    "SyncPlayer.Domain": "1.0.0-*",
    "SyncPlayer.Dropbox": "1.0.0-*",
    "System.Runtime.Serialization.Primitives": "4.1.1-rc2-24027"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

And the StackTrace of the exception thrown:

System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'. The system cannot find the file specified. File name: 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' at Dropbox.Api.Files.SearchArg..ctor(String path, String query, UInt64 start, UInt64 maxResults, SearchMode mode) at Dropbox.Api.Files.Routes.FilesRoutes.SearchAsync(String path, String query, UInt64 start, UInt64 maxResults, SearchMode mode) at SyncPlayer.Dropbox.DropboxClientWrapper.d__4.MoveNext() in E:\Projects\SyncPlayer.Core\SyncPlayer\SyncPlayer.Dropbox\DropboxClientWrapper.cs:line 47 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SyncPlayer.Dropbox.DropboxDataStore.<SearchAsync>d__3.MoveNext() in E:\Projects\SyncPlayer.Core\SyncPlayer\SyncPlayer.Dropbox\DropboxDataStore.cs:line 27 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SyncPlayer.Dropbox.Services.DropboxFileFinderService.d__4.MoveNext() in E:\Projects\SyncPlayer.Core\SyncPlayer\SyncPlayer.Dropbox\Services\DropboxFileFinderService.cs:line 28 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SyncPlayer.Domain.FileFinderFacade.<FindAudioFileAsync>d__5.MoveNext() in E:\Projects\SyncPlayer.Core\SyncPlayer\SyncPlayer.Domain\FileFinderFacade.cs:line 27 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SyncPlayer.SPA.Controllers.HomeController.d__2.MoveNext() in E:\Projects\SyncPlayer.Core\SyncPlayer\SyncPlayer.SPA\Controllers\HomeController.cs:line 18

I'm probably missing some configuration on the web app, any ideas ?!

3
  • does SyncPlayer actually supports Core Clr? If it does not you probably should target full .NET (net451) and not netcoreapp1.0
    – Pawel
    Commented Jul 23, 2016 at 7:49
  • Yes, it supports Core clr.
    – Zbrr
    Commented Jul 23, 2016 at 8:45
  • Did you solve this? I'm getting the same issue.
    – Dan
    Commented Mar 1, 2017 at 21:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.