Closed iamkeyur closed 3 years ago
Hi @iamkeyur
No, it wouldn't be possible to port to .Net core because it relies on the Office interops. The main body of the code will port to .Net core, but it'll never be cross platform because of the requirement for the interops. See https://github.com/dotnet/core/issues/402
The only way around this would be to stop using the interops and use a commercial .net package for the document handling (e.g. Aspose https://products.aspose.com/total). The downside is you'd need a commercial license for this and rendering of documents probably wouldn't be as accurate as it is using the native Office code.
Thanks. I know that it won't be cross-platform. I just wanted it to port to .NET Core to make it more modern.
It is possible to use COM interop using .NET Core, .NET 5, or .NET 6. Just set the target framework correctly to include -windows. Example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
Thank you for the work. @vittala Would it be possible to port this to .Net Core? If yes, what would be main hurdles? I can work on this port.