.NET Framework 4.8错误参考Microsoft.office.core

发布于 2025-02-07 06:49:24 字数 2588 浏览 1 评论 0原文

我试图在.NET框架的新版本上构建一个旧项目。当我尝试构建该项目时,发生错误。

“文件或汇编” Interop.microsoft.office.core或找不到它的依赖。

LOG: DisplayName = Interop.Microsoft.Office.Core
 (Partial.)
WRN: Partial binding information was provided for an assembly:
WRN: Assembly name: Interop.Microsoft.Office.Core | Domain ID: 2
WRN: Partial binding occurs when only part of the assembly display name is provided.
WRN: This may cause the collection folder to load an incorrect assembly.
WRN: Specify the text identity of the assembly with full details. 
WRN: This includes the simple name, version and culture, and public key token.
WRN: For more information and general solutions to this problem, see the whitepaper at "http://go.microsoft.com/fwlink/?LinkId=109270".
LOG: Appbase = file:///C:/Users/krebesli/OneDrive - TRUMPF SE + Co. KG/Project - Copy/TruTopsSales/TruTopsSales/
LOG: Original PrivatePath = C:\Users/krebesli/OneDrive - TRUMPF SE + Co. KG\Project - copy\TruTopsSales\TruTopsSales\bin
Call from Assembly : (Unknown).
===
LOG: This binding starts in default load context.
LOG: The application configuration file is used: C:\Users\krebesli\OneDrive - TRUMPF SE + Co. KG\Project - copy\TruTopsSales\TruTopsSales\web.config.
LOG: The host configuration file is used: \srvditz1\home$\krebesli\Documents\IISExpress\config\aspnet.config.
LOG: The computer configuration file of C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config is used.
LOG: policy is not currently applied to the reference (private, custom, partial, or path-based assembly binding).
LOG: download of new URL file:///C:/Users/(username)/AppData/Local/Temp/Temporary ASP.NET Files/vs/2636e7dd/88283cb5/Interop.Microsoft.Office.Core.DLL.
LOG: Download of new URL file:///C:/Users/(username)/AppData/Local/Temp/Temporary ASP.NET Files/vs/2636e7dd/88283cb5/Interop.Microsoft.Office.Core/Interop.Microsoft.Office.Core.DLL.
LOG: Download from new URL file:///C:/Users/(username)/.../.../.../bin/Interop.Microsoft.Office.Core.DLL.
ERR: Assembly setup could not be completed (hr = 0x8007000b). The search was terminated.

error_message

我参考此dll

dll's

我还通过(我相信)通过参考管理器com tab

  • ​。

​ 我现在尝试了evrything,但没有进入解决方案

更新:

Nuget已安装软件包 nuget

Im trying to build an old project on a new version of the .NET Framework. When I'm trying to build that Project an Error occurs.

"The file or assembly "Interop.Microsoft.Office.Core" or a dependency of it was not found. An attempt was made to load a file with an incorrect format."

LOG: DisplayName = Interop.Microsoft.Office.Core
 (Partial.)
WRN: Partial binding information was provided for an assembly:
WRN: Assembly name: Interop.Microsoft.Office.Core | Domain ID: 2
WRN: Partial binding occurs when only part of the assembly display name is provided.
WRN: This may cause the collection folder to load an incorrect assembly.
WRN: Specify the text identity of the assembly with full details. 
WRN: This includes the simple name, version and culture, and public key token.
WRN: For more information and general solutions to this problem, see the whitepaper at "http://go.microsoft.com/fwlink/?LinkId=109270".
LOG: Appbase = file:///C:/Users/krebesli/OneDrive - TRUMPF SE + Co. KG/Project - Copy/TruTopsSales/TruTopsSales/
LOG: Original PrivatePath = C:\Users/krebesli/OneDrive - TRUMPF SE + Co. KG\Project - copy\TruTopsSales\TruTopsSales\bin
Call from Assembly : (Unknown).
===
LOG: This binding starts in default load context.
LOG: The application configuration file is used: C:\Users\krebesli\OneDrive - TRUMPF SE + Co. KG\Project - copy\TruTopsSales\TruTopsSales\web.config.
LOG: The host configuration file is used: \srvditz1\home$\krebesli\Documents\IISExpress\config\aspnet.config.
LOG: The computer configuration file of C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config is used.
LOG: policy is not currently applied to the reference (private, custom, partial, or path-based assembly binding).
LOG: download of new URL file:///C:/Users/(username)/AppData/Local/Temp/Temporary ASP.NET Files/vs/2636e7dd/88283cb5/Interop.Microsoft.Office.Core.DLL.
LOG: Download of new URL file:///C:/Users/(username)/AppData/Local/Temp/Temporary ASP.NET Files/vs/2636e7dd/88283cb5/Interop.Microsoft.Office.Core/Interop.Microsoft.Office.Core.DLL.
LOG: Download from new URL file:///C:/Users/(username)/.../.../.../bin/Interop.Microsoft.Office.Core.DLL.
ERR: Assembly setup could not be completed (hr = 0x8007000b). The search was terminated.

Error_message

I reference this dll's

dll's

I also add them via the (I believe) correct workflow via the reference managers COM Tab

COM Tab

  • The Microsoft.Office.Core reference adds via the Microsoft Office 16.0 Object Library
  • The Microsoft.Office.Interop.Excel reference adds via the Microsoft Excel 16.0 Object Library
  • The Microsoft.Office.Interop.Word reference adds via the Microsoft Word 16.0 Object Library

Has anyone a clue what I do wrong?
I tried now evrything and didnt come to an solution

UPDATE:

NuGet installed packages
NuGet

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贱贱哒 2025-02-14 06:49:24

服务器端自动化的注意事项文章说以下内容:

Microsoft当前不建议使用任何无人看管的非相互作用客户端应用程序或组件(包括ASP,ASP,ASP.NET,DCOM和NT Services)的Microsoft Office应用程序的自动化,因为Office可能会表现出不稳定的在此环境中运行办公室时的行为和/或僵局。

如果您要构建在服务器端上下文中运行的解决方案,则应尝试使用已安全执行的组件。或者,您应该尝试找到允许至少一部分代码运行客户端的替代方案。如果您使用服务器端解决方案的Office应用程序,则该应用程序将缺乏成功运行的许多必要功能。此外,您将在整体解决方案的稳定性下冒险。

如果处理Exchange帐户(Graph API的Office 365),则可以考虑使用EWS或图形API。或者只是考虑使用为服务器端执行设计的第三方组件。

The Considerations for server-side Automation of Office article says the following:

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.

You may consider using EWS or Graph API if you deal with Exchange accounts (Office 365 for Graph API). Or just consider using third-party components designed for the server-side execution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文