Nugget htmlagilitypack.1.8.4和microsoft.office.interop.excel安装问题 [英] Nugget htmlagilitypack.1.8.4 and microsoft.office.interop.excel install problem

查看:122
本文介绍了Nugget htmlagilitypack.1.8.4和microsoft.office.interop.excel安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我需要在我的应用程序中使用Excel。所以,我试图用nugget包安装Microsoft.Office.Interop.Excel,但是它给出了以下错误:



Hello,

I need to work with Excel in my application. so, I am trying to install Microsoft.Office.Interop.Excel with nugget package but it is giving below error :

Install-Package : An error occurred while retrieving package metadata for 'HtmlAgilityPack.1.8.4' from source 'E:\Sample\packages'.

Attempting to gather dependencies information for package 'Microsoft.Office.Interop.Excel.15.0.4795.1000' with respect to project 'Sample', targeting '.NETFramework,Version=v4.5.2'

Install-Package : An error occurred while retrieving package metadata for 'HtmlAgilityPack.1.8.4' from source 'E:\Sample\packages'.

At line:1 char:16 + Install-Package <<<< C:\Users\admin\Downloads\Microsoft.Office.Interop.Excel.15.0.4795.1000.nupkg + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand





我正在尝试使用包管理器控制台中的以下命令。



PM>安装包Microsoft.Office.Interop.Excel -Version 15.0.4795.1000



任何人都可以知道发生了什么事吗?

< br $> b $ b谢谢,



我的尝试:



我尝试使用diff版本,但没有运气。



I am trying with below command in package manager console.

PM> Install-Package Microsoft.Office.Interop.Excel -Version 15.0.4795.1000

can any one have any clue what is happening?

Thanks,

What I have tried:

I tried with diff versions but no luck.

推荐答案

软件包 Microsoft.Office.Interop.Excel.15.0.4795.1000 未在官方NuGet网站上列出。而且我看不出有什么理由会依赖HTML Agility Pack。



然而,你已经标记了你的作为ASP.NET的问题。 Office Interop不能在ASP.NET应用程序中使用:

The package Microsoft.Office.Interop.Excel.15.0.4795.1000 is not listed on the official NuGet site. And I can't see any reason why it would have a dependency on the HTML Agility Pack.

However, you've tagged your question as ASP.NET. Office Interop cannot be used in ASP.NET applications:

Microsoft目前不推荐也不支持从任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务)自动化Microsoft Office应用程序,因为Office在此环境中运行时可能会出现不稳定的行为和/或死锁。

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.



有多种方法可以在不使用Office互操作的情况下在服务器上读取和创建Excel电子表格。例如:

  • EPPlus [ ^ ];
  • ClosedXML [ ^ ];
  • OpenXML SDK [ ^ ];

  • There are various ways to read and create Excel spreadsheets on the server without using Office interop. For example:

    • EPPlus[^];
    • ClosedXML[^];
    • The OpenXML SDK[^];

    • 这篇关于Nugget htmlagilitypack.1.8.4和microsoft.office.interop.excel安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆