tweetinvi: The type initializer for 'Tweetinvi.Auth' threw an exception. System.Collections

I’ve seen similar issues in this repository, but couldn’t fix it. If I revert back the Tweetinvi 4.0 it works.

There are 2 inner exceptions.

First (this version does not exist on Nuget): FileNotFoundException: Could not load file or assembly ‘System.Collections, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

Second: FileNotFoundException: Could not load file or assembly ‘System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

I’ve also tried something this for app.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
  </startup>
  <runtime>
    <assemblyBinding>
      <dependentAssembly>
        <assemblyIdentity name="System.Collections" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

4.8 fixed nothing for me.

I managed to solve it. In the end, I had to get the latest version of the code and make sure all the projects in the solution have “.Net Standard 2.0” set as their Target Framework. After that rebuild and manually reference the new DLLs in your project

.NET Framework 4.8 have not fixed the issue for me, still having the error

I have tested and it seems that .NET Framework 4.8 have fixed the issue.

It seems like a workaround. Sorry for not looking at this earlier.

I will be ensuring that next version does work for them all.