I'm using FreeSpire from nuget in my Xamarin.Forms app to convert an RTF file to HTML (RTFPipe can't parse the file correctly).
I'm using the line
var doc = new Document();
to create an empty document. However, when the debugger hits that line, the following exception is thrown
System.ArgumentNullException: 'Value cannot be null. Parameter name: path1
The stacktrace shows the following
at System.IO.Path.Combine (System.String path1, System.String path2) [0x00003] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.IO/Path.cs:102 at Spire.License.LicenseProvider.? (System.Type A_0) [0x00b04] in <cbf4d19d91bc48bebfd56cc173b03744>:0 at Spire.License.LicenseProvider.? (System.Type A_0) [0x000eb] in <cbf4d19d91bc48bebfd56cc173b03744>:0 at Spire.License.LicenseProvider.GetLicense (System.ComponentModel.LicenseContext context, System.Type type, System.Object instance, System.Boolean allowExceptions) [0x0013c] in <cbf4d19d91bc48bebfd56cc173b03744>:0 at System.ComponentModel.LicenseManager.ValidateInternalRecursive (System.ComponentModel.LicenseContext context, System.Type type, System.Object instance, System.Boolean allowExceptions, System.ComponentModel.License& license, System.String& licenseKey) [0x0005d] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs:316 at System.ComponentModel.LicenseManager.ValidateInternal (System.Type type, System.Object instance, System.Boolean allowExceptions, System.ComponentModel.License& license) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs:276 at System.ComponentModel.LicenseManager.IsValid (System.Type type, System.Object instance, System.ComponentModel.License& license) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs:236 at Spire.Doc.Document.? () [0x00083] in <cadd5a62e86a41f7af17954bf73d8f6c>:0 at Spire.Doc.Document..ctor () [0x000d7] in <cadd5a62e86a41f7af17954bf73d8f6c>:0 at Quizical.Droid.Injected.RTFConvert.ConvertRTF (System.String storage, System.String filename) [0x0000b] in C:UsersPaulsource
eposceditacorporateQuizicalQuizicalQuizical.AndroidInjectedRTFConvert.cs:14 at Quizical.ViewModels.UIElementsViewModel.<.ctor>b__2_1 (System.String t) [0x00020] in C:UsersPaulsource
eposceditacorporateQuizicalQuizicalQuizicalViewModelsUIElementsViewModel.cs:54 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
My understanding is that Freespire doesn't need a licence which the stacktrace suggests is missing.
question from:
https://stackoverflow.com/questions/65598928/spire-doc-gives-system-argumentnullexception-when-instantiating-a-new-object 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…