Excel Interop C# 和部署到生产框
我正在使用包含 WCF 服务的 C# (VS 2008) 中的 Excel Interop。它在我的开发盒中运行良好。但是在生产服务器上,我们没有安装MS Office,也没有安装VS2008。为了使 Excel Interop 正常工作,需要在生产服务器中做什么?我是否将 Interop DLL 打包到 bin 文件夹中?这是如何运作的?
请告诉我。
谢谢。
I'm using the Excel Interop in C# (VS 2008) wrapped around WCF service. It works fine in my development box. However on the production server, we don't have the MS Office installed nor VS2008. What needs to be done in the production server in order to make Excel Interop work fine? Do I package the Interop DLLs into the bin folder? How does that work?
Please let me know.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以在部署包中包含互操作程序集,但您请记住,这些程序集只是非托管 Excel 库的包装器,因此您需要在生产设备上安装 Excel 才能正常工作。如果这是一个服务器应用程序,您可能根本不应该使用 Excel 互操作,因为 Excel 是一个客户端应用程序,不适合在重型多线程环境(例如 ASP.NET 应用程序)中使用。
Yes you can include the interop assemblies in your deployment package but you remember that those assemblies are just wrappers around unmanaged Excel libraries so you need to install Excel on the production box for this to work. And if this is a server application you probably shouldn't be using Excel interop at all as Excel is a client application not intended to be used in a heavy multithreaded environment such as an ASP.NET application.