I'm using a DropboxClient
object in an MVC project and is working fine, but I need to use it in ASP.NET Core, and when I try to use exactly the same code in ASP.NET Core I'm getting some compile time errors, these are the errors:
The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
'DropboxClient': type used in a using statement must be implicitly convertible to 'System.IDisposable'
The type 'Task<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
I think that all these errors are related to some configuration that I need to do in ASP.net Core, in MVC the code runs without problem.
This is the code:
public IActionResult Index()
{
using (DropboxClient client = new DropboxClient("dddddddddddddsdadffsdf343"))
{
var full = client.Users.GetCurrentAccountAsync();
var result = full.Result.Email;
var other = full.Result.Country;
var other2 = full.Result.Name;
}
return View();
}
What do I need to change in ASP.net Core in order for this code to run?