DotNetty icon indicating copy to clipboard operation
DotNetty copied to clipboard

The type initializer for 'DotNetty.Transport.Bootstrapping.Bootstrap' threw an exception

Open bikamani opened this issue 5 years ago • 2 comments

We have a dependency on MicrosoftExtensionsLoggingVersion and noticed BootStrap exception during build as below:

{"The type initializer for 'DotNetty.Transport.Bootstrapping.Bootstrap' threw an exception."}

  •   InnerException	{"Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.":"Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"}	System.Exception {System.IO.FileNotFoundException}
    

From dependency.version.props: MicrosoftExtensionsLoggingVersion 2.2.0 /MicrosoftExtensionsLoggingVersion

Currently we have updated version to older release and added reference to MicrosoftExtensionsLoggingAbstractionsVersion as a temporary fix to unblock: MicrosoftExtensionsLoggingVersion 1.1.1 /MicrosoftExtensionsLoggingVersion MicrosoftExtensionsLoggingAbstractionsVersion 1.1.1 /MicrosoftExtensionsLoggingAbstractionsVersion

What is the right solution for the bootstrap exception with latest version of MicrosoftExtensionsLoggingVersion?

bikamani avatar Sep 10 '19 18:09 bikamani

The same problem appears to me

waelmg50 avatar Jul 20 '20 09:07 waelmg50

You need to check bindingRedirects in your used app.config. Add bindingRedirect for Microsoft.Extensions.Logging.Abstractions and dependent assymblies. FileNotFoundException contains FusionLog about a requered assembly. For example, this is resolved the problem:

	    <dependentAssembly>
		    <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
		    <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
	    </dependentAssembly>
	    <dependentAssembly>
		    <assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral"/>
		    <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
	    </dependentAssembly>
	    <dependentAssembly>
		    <assemblyIdentity name="System.Reactive" publicKeyToken="94bc3704cddfc263" culture="neutral"/>
		    <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
	    </dependentAssembly>

Leomana8 avatar Jul 14 '21 16:07 Leomana8