← 输入框|github.com|刷新
Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

i got the TypeLoadException in new statement  #151

Open

Description

@elraider33

Hi i have this code
var client = new DropNetClient(Utilities.Functions.ReadAppSetting("DropBox:ApiKey"),
Utilities.Functions.ReadAppSetting("DropBox:AppSecret"));
after that i got the next exception:

An exception of type 'System.TypeLoadException' occurred in DropNet.dll but was not handled in user code

Additional information: Could not load type 'RestSharp.IAuthenticator' from assembly 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null'

i have dropnet 1.10.23.o installed.

thanks

Activity

  1. nivasboy19 commented on Oct 19, 2015

    @nivasboy19

    I have the same problem.

    Did you solved? Can you say me how?

  2. alexjorgef commented on Oct 19, 2015

    @alexjorgef

    I'm having the same problem when dropnet nuget package was updated. the project was on .net 4.5 and the exception come from here:

            try
            {
                _client = new DropNet.DropNetClient(_apikey, _apisecret, userToken, userSecret) { UseSandbox = true };
            }
            catch (TypeLoadException e1)
            {
                Debug.WriteLine(e1.Message);                
                throw;
            }
            catch (TargetInvocationException e2)
            {
                Debug.WriteLine(e2.Message);
                throw;
            }
    

    Btw i have to comment this debug line because .Content seems to be a syntax error:

    MessageBox.Show(restError != null ? restError.Response.Content : error.Message);

    The Debug Ouput:

    A first chance exception of type 'System.NullReferenceException' occurred in AlexCommands.exe
    A referência de objecto não foi definida como uma instância de um objecto.
    A first chance exception of type 'System.TypeLoadException' occurred in DropNet.dll
    Não foi possível carregar o tipo 'RestSharp.IAuthenticator' da assemblagem 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null'.
    A first chance exception of type 'System.TypeLoadException' occurred in AlexCommands.exe
    A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

  3. elraider33 commented on Oct 20, 2015

    @elraider33
    Author

    uninstalling both (dropnet and restsharp) from all projects in the solution and reinstalling them, solved the issue. Hope this help you.

  4. nivasboy19 commented on Oct 20, 2015

    @nivasboy19

    Doesn't work to me.

    I tried to reinstall but nothing change.

    Could be a problem because is a TFS(Team Fundation) project?
    In other project withou TFS works perfectly.

  5. elraider33 commented on Oct 20, 2015

    @elraider33
    Author

    in this case; first uninstall the packages, then do a check in; after that, reinstall the packages; it worked for me using visual studio online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions