The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception

MMS library for .NET

Moderator: alt

Post Reply
soonchew
Posts: 3
Joined: Thu Sep 09, 2021 9:39 am

The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception

Post by soonchew » Tue Nov 16, 2021 7:52 am

Hi,

We are trying to use the library in a .net core function project. But we get below error

The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
File name: 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at s5vEEkOOTYfpG8HoP9V.JuPp3jOJKI8hNvrs3dX.n5YXMFyn5g(Byte[] )
at s5vEEkOOTYfpG8HoP9V.JuPp3jOJKI8hNvrs3dX.GetLicense(LicenseContext , Type , Object , Boolean )
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.Validate(Type type)
at Inetlab.MMS.MMSMessage.wvQ9sK8TPl7hekoNwQI(Type )
at Inetlab.MMS.MMSMessage..cctor()
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Re: The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception

Post by alt » Fri Nov 19, 2021 3:31 pm

Hi,

Please try pre-release version 1.0.0-beta-190705
soonchew
Posts: 3
Joined: Thu Sep 09, 2021 9:39 am

Re: The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception

Post by soonchew » Mon Nov 22, 2021 9:51 am

That works!
However when sending MMS, it seems we will get below error for the first MMS. Subsequent MMS is ok.

System.ArgumentException: Item has already been added. Key in dictionary: 'binary' Key being added: 'binary' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.Add(Object key, Object value) at Inetlab.MMS.MIME.MessageBodyEncoding..ctor() at Inetlab.MMS.MIME.MessageBodyEncoding.GetInstance() at Inetlab.MMS.MIME.MessageBase.Encode(String encoding, Byte[] data) at Inetlab.MMS.MIME.MessageBase.MessageStream(Boolean printHeaders) at Inetlab.MMS.MediaMessage.GetBytes(Boolean includeHeaders) at Inetlab.MMS.MediaMessage.GetBytes() at Inetlab.MMS.MM7Client.††† ††††‡—(Uri , MediaMessage ) at Inetlab.MMS.MM7Client.††† ††††‡•(MediaMessage ) at Inetlab.MMS.MM7Client.Submit(MMSMessage message, SubmitRequest req) at Inetlab.MMS.MM7Client.Submit(MMSMessage message, ChargedParty chargedParty) at Inetlab.MMS.MM7Client.Submit(MMSMessage message)
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Re: The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception

Post by alt » Mon Nov 22, 2021 2:13 pm

Thank you for reporting this bug. I'll try to fix it as soon as possible.
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Re: The type initializer for 'Inetlab.MMS.MMSMessage' threw an exception

Post by alt » Wed Nov 24, 2021 6:44 pm

This issue is fixed in the version 1.0.0-beta-2580.

Please note: The method Submit in the MM7Client class is now Task-based.
Post Reply