Reputation: 1234
I am trying to use Microsoft.Office.Interop.Word in an asp.net core 1.0 application, but its not supported in .net core app when I try to add reference to the dll I get this error
Error NU1002 The dependency Microsoft.Office.Interop.Word 15.0.4797.1003 does not support framework .NETCoreApp,Version=v1.0.
see the below image.
since its not supported is there a way to work with Microsoft office word files in .net core 1 application?
note that same problem occur when using openxml sdk
Upvotes: 4
Views: 5008
Reputation: 24515
I am using .Net Core 1.1 and found this Open XML SDK library to work.
See: https://github.com/OfficeDev/Open-XML-SDK
You will need to get the latest CI build via nuget from this feed:
https://dotnet.myget.org/F/open-xml-sdk/api/v3/index.json
Upvotes: 1
Reputation: 49395
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.
As a workaround you may consider using the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office for more information. Or just any third-party components designed for the server-side use.
Upvotes: 1
Reputation: 140
Syncfusion File Format libraries for reading, writing and manipulating Word, Excel, PDF and PowerPoint files, will be capable of being used with ASP.NET Core 1.0 from their upcoming release. Please create an thread in their support system to get more details about it.
Note: I work for Syncfusion.
Upvotes: 1