eBay / ebay-oauth-csharp-client

eBay OAuth C# Client Library
Apache License 2.0
54 stars 40 forks source link

Errror FileLoadException RestSharp #20

Open ulric03 opened 3 years ago

ulric03 commented 3 years ago

I am load GetApplicationToken CredentialUtil.Load(path); IList<string> list = new List<string>() { "https://api.ebay.com/oauth/api_scope" }; OAuthResponse oAuthResponse = new OAuth2Api().GetApplicationToken(eBay.ApiClient.Auth.OAuth2.Model.OAuthEnvironment.SANDBOX, list); but a get next error System.IO.FileLoadException: 'Could not load file or assembly 'RestSharp, Version=106.5.4.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. Could not find or load a specific file. (0x80131621)' in my csproj i add <PackageReference Include="RestSharp" Version="106.5.4" />

Has anyone ever experienced this? can you help me

ChiaraMariee commented 2 years ago

I've got the same issue were qou able to resolve it?

bounav commented 1 year ago

Some older version of nuget packages don't have a publicKeyToken value, if you happen to also depend on a more recent version of the nuget package that does set that value, then you're going to have these FileLoadException because in your build output msbuild will include the more recent version of the .dll and the publicKeyToken value won't match.

FYI: You can see what the publicKeyToken for given .dll is with this powershell command:

[Reflection.AssemblyName]::GetAssemblyName('C:\path\to\YourDependency.dll').FullName

This issue should be addressed by the pull request I submitted with along issue #27.

bounav commented 10 months ago

This shouldn't be an issue since PR #30.