.net-core - 构建错误:COMReference .NET CORE 3.0:未找到 AxImp
问题描述
我正在尝试编译具有 COM 引用的 .NET CORE 3.0 应用程序。不幸的是,在尝试构建具有引用的应用程序时,我收到了构建错误:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2726,5):
error MSB3091:
Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed.
The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the
InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.7.2\WinSDK-NetFx40Tools-x86.
You may be able to solve the problem by doing one of the following:
1) Install the Microsoft Windows SDK.
2) Install Visual Studio 2010.
3) Manually set the above registry key to the correct location.
4) Pass the correct location into the "ToolPath" parameter of the task.
我知道设置或配置可能有问题(?),但无法弄清楚到底是什么。我安装了 Visual Studio 2019(撰写本文时的最新版本,16.3.9)。该应用程序设置为目标 .NET CORE 3.0,它应该支持<ComReference ...>
元素。
如何使用 Visual Studio 2019 构建具有 .NET CORE 3.0 的 COM REFERENCE 的应用程序?我正在从 VS2019 IDE 构建。据我了解,它甚至不应该寻找“AxImp”,它可能应该寻找“TlbImp”。另外,为什么要寻找 Visual Studio 2010?已安装 Windows SDK。它需要一些特定的版本吗?哪一个?
我尝试使用项目引用删除然后再次添加引用,没有任何改变。我错过了什么吗?
解决方案
安装 .NET SDK 4.7.2 后,问题就消失了。我之前有 4.8 版本(默认安装 VS 2019)
推荐阅读
- javascript - 尝试/捕获未捕获快速异步函数中的所有错误?
- android - 如何在我的应用上自动播放 youtube 视频?
- go - 如何在 GoLang 测试用例中查询错误对象?
- javascript - Django视图AttributeError:'str'对象没有属性'get'
- node.js - 猫鼬 .populate()
- grep - 如何使用匹配模式的 [grep] 显示整行?
- python - 屏幕截图程序 - 透明截图区域
- node.js - Tensorflow.js => TypeError:response.arrayBuffer 不是函数
- r - 将 SAS 语言翻译成 R 语言:创建新变量
- xmpp - 如果我通过 JWT 使用 Ejabberd 身份验证,我不需要注册用户吗?