Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

TypeInitializationException with v3.0.0 #30

Closed
tipa opened this issue Nov 19, 2019 · 2 comments
Closed

TypeInitializationException with v3.0.0 #30

tipa opened this issue Nov 19, 2019 · 2 comments
Labels

Comments

@tipa
Copy link

tipa commented Nov 19, 2019

With Simplexcel v3.0.0 I am running into exceptions when building my app in Release-Mode.

Xamarin.Android:

System.TypeInitializationException: The type initializer for 'Simplexcel.SimplexcelVersion' threw an exception. ---> System.IO.FileNotFoundException: Simplexcel.dll
at System.Diagnostics.FileVersionInfo.GetVersionInfo (System.String fileName) <0x6f73086bc8 + 0x000fc> in <e0002483da9347d790cb4bc782ce44a7>:0 
at Simplexcel.SimplexcelVersion..cctor () <0x6f71793d20 + 0x0005b> in <c2d8b95c35a1425e971032ecb3ce33cb>:0 
--- End of inner exception stack trace ---
at Simplexcel.SimplexcelVersion.get_Version () <0x6f71793cbc + 0x00040> in <c2d8b95c35a1425e971032ecb3ce33cb>:0 
at Simplexcel.XlsxInternal.XlsxPackage.WriteInfoXmlFile (Simplexcel.XlsxInternal.ZipPackage pkg) <0x6f71799220 + 0x0019f> in <c2d8b95c35a1425e971032ecb3ce33cb>:0 
at Simplexcel.XlsxInternal.XlsxPackage.SaveToStream (System.IO.Stream outputStream, System.Boolean compress) [0x00026] in <c2d8b95c35a1425e971032ecb3ce33cb>:0 
at Simplexcel.XlsxInternal.XlsxWriter+XlsxWriterInternal.Save (Simplexcel.Workbook workbook, System.IO.Stream outputStream, System.Boolean compress) <0x6f71799c70 + 0x002f7> in <c2d8b95c35a1425e971032ecb3ce33cb>:0 
at Simplexcel.Workbook.Save (System.IO.Stream stream, System.Boolean compress) <0x6f71793ff8 + 0x000a3> in <c2d8b95c35a1425e971032ecb3ce33cb>:0 

UWP:

System.TypeInitializationException: A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property. ---> System.ArgumentException: The path is empty.
Parameter name: path
   at System.IO.Path.GetFullPath(String) + 0xf4
   at System.Diagnostics.FileVersionInfo.GetVersionInfo(String) + 0x1b
   at Simplexcel.SimplexcelVersion..cctor() + 0x3a
   at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xf1

   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x1ad
   at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstruction(Void*, StaticClassConstructionContext*) + 0xf
   at Simplexcel.XlsxInternal.XlsxPackage.WriteInfoXmlFile(ZipPackage) + 0x18c
   at Simplexcel.XlsxInternal.XlsxPackage.SaveToStream(Stream, Boolean) + 0x78
   at Simplexcel.XlsxInternal.XlsxWriter.XlsxWriterInternal.Save(Workbook, Stream, Boolean) + 0x4af
   at Simplexcel.XlsxInternal.XlsxWriter.Save(Workbook, Stream, Boolean) + 0x13
   at Simplexcel.Workbook.Save(Stream, Boolean) + 0x9a
@tipa tipa changed the title Issues with v3.0.0 in Xamarin.Android & UWP app TypeInitializationException with v3.0.0 Nov 19, 2019
@mstum mstum added the 3.1 label Nov 20, 2019
@mstum
Copy link
Owner

mstum commented Nov 20, 2019

I've committed a fix to master, and a Pre-Release/Dev Nuget package is available here (you can download the package.nupkg): https://github.com/mstum/Simplexcel/packages/48179?version=3.0.1.183-master

I'll try it out in a Xamarin.Android app and publish it to Nuget.org in a bit.

@mstum mstum added 3.0.1 and removed 3.1 labels Nov 20, 2019
@mstum
Copy link
Owner

mstum commented Nov 20, 2019

Version 3.0.1.184 published to nuget.org: https://www.nuget.org/packages/simplexcel/

@mstum mstum closed this as completed Nov 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants