Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I'm trying to use the Dropbox API with an ASP.NET Core application (v1.1.0). It compiles and resolves all the dependencies when doing a "dotnet restore", but when I call one of the Dropbox API methods, it throws the following exception...
An unhandled exception has occurred: 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. 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.ListFolderArg..ctor(String path, Boolean recursive, Boolean includeMediaInfo, Boolean includeDeleted, Boolean includeHasExplicitSharedMembers at Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderAsync(String path, Boolean recursive, Boolean includeMediaInfo, Boolean includeDeleted, Boolean includeHasExplicitSharedMembers at ******.Core.Respositories.BlogPostDropboxRepository.d__4.MoveNext() in C:\code\******\******.Core\Respositories\BlogPostDropboxRepository.cs:line 31 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult( at ******.Controllers.HomeController.d__2.MoveNext() in C:\code\******\******.Web\Controllers\HomeController.cs:line 18 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__25.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResourceExecutedContext context at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw( at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.d__6.MoveNext()
Looks very similar to this unanswered Stackoverflow question I found when trying to Google for a solution:
http://stackoverflow.com/questions/38535571/dropbox-api-throws-filenotfoundexception
Hi. Thank you for your very quick reply!
I've found the issue. It was because when I created the project, it had this in the project.json
"frameworks": { "netstandard1.6": { "imports": "dnxcore50" } }
So that was saying that my assembly targets netstandard 1.6, but the 'imports' bit is telling it to lie to the compiler saying that dependencies targeting dnxcore50 will work. Hence why it compiled, but fell over at runtime.
I've fixed the issue by just targeting dnxcore50 instead.
It would be great if Dropbox API targetted the latest dotnet standard though 🙂
Brilliant! This works perfectly. Thanks a lot for your help! 🙂
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!