xceedsoftware / DocX

Fast and easy to use .NET library that creates or modifies Microsoft Word files without installing Word.
Other
1.73k stars 468 forks source link

DocX for Unity / iOS #428

Open MattBell96 opened 2 years ago

MattBell96 commented 2 years ago

Hi there, I am developing an application for unity3D using docX. My application works just fine in the unity editor. But when I try to build it (Targeting iOS) it does not build. It gives me:

ArgumentException: The Assembly WindowsBase is referenced by Xceed.Document.NET ('Assets/Plugins/Xceed.Document.NET.dll'). But the dll is not allowed to be included or could not be found.

I then add WindowsBase.dll to my plugins folder to get past this. But get this:

Loading assembly failed: "Assets/Plugins/WindowsBase.dll" reason: File does not contain a valid CIL image

Despite this Error I am able to build to iOS. However when I run the app and try to create a new document i get this in Xcode:

NullReferenceException: Object reference not set to an instance of an object. at System.IO.Packaging.Package.Open (System.IO.Stream stream, System.IO.FileMode packageMode, System.IO.FileAccess packageAccess) [0x00000] in <00000000000000000000000000000000>:0 at Xceed.Document.NET.Document.PrepareDocument (Xceed.Document.NET.Document& document, Xceed.Document.NET.DocumentTypes documentType) [0x00000] in <00000000000000000000000000000000>:0 at Xceed.Words.NET.DocX.Create (System.String filename, Xceed.Document.NET.DocumentTypes documentType) [0x00000] in <00000000000000000000000000000000>:0

Any help would really be appreciated.

XceedBoucherS commented 2 years ago

Hello, The OpenSource version of DocX has only been tested for Windows, it's a .NET Framework version. The Commerical version of DocX, named "Xceed Words for .NET" contains a .NET5 and a .NETStandard version which may work better in iOS.

I invite you to try it here : https://xceed.com/en/our-products/product/words-for-net You can use it for free for 15 days.

Thank you.

ibrahimpenekli commented 1 year ago

@MattBell96 any updates?

XceedBoucherS commented 1 year ago

hi, Have you tried the latest version on gitHub : v2.3 ? It includes .NET5 dlls, which works on .NET5/6 applications. Does it works better in you environment ? Thank you

ibrahimpenekli commented 1 year ago

Unity does not support .NET5/6: https://docs.unity3d.com/2021.3/Documentation/Manual/dotnetProfileSupport.html

It depends on 'WindowsBase.dll' which is not available on iOS/macOS etc. But, it works fine on Editor/Windows.

XceedBoucherS commented 1 year ago

Ok, We'll have to test, but this product is mainly built for Windows. Thank you.