ebay-oauth-csharp-client icon indicating copy to clipboard operation
ebay-oauth-csharp-client copied to clipboard

Errror FileLoadException RestSharp

Open ulric03 opened this issue 4 years ago • 3 comments

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

ulric03 avatar Apr 23 '21 21:04 ulric03

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

ChiaraMariee avatar Nov 26 '21 14:11 ChiaraMariee

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 avatar Jun 22 '23 09:06 bounav

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

bounav avatar Aug 16 '23 09:08 bounav