生成错误: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.

生成错误:COMReference .NET CORE 3.0:找不到AxImp

我了解设置或配置(?)可能有问题,但无法确切找出原因。我已经安装了Visual Studio 2019(在撰写本文时,最新版本是16.3.9)。该应用程序设置为目标.NET CORE 3.0,该目标应支持<ComReference ...>元素。

如何使用Visual Studio 2019构建具有COM引用和.NET CORE 3.0的应用程序?我正在从VS2019 IDE构建。据我了解,它甚至不应该寻找“ AxImp”,它可能应该寻找“ TlbImp”。另外,为什么要寻找Visual Studio 2010? Windows SDK已安装。是否需要某些特定版本?哪一个?

我尝试删除,然后使用项目引用再次添加引用,但未进行任何更改。我想念什么吗?

hongchengge 回答:生成错误:COMReference .NET CORE 3.0:找不到AxImp

在安装.NET SDK 4.7.2之后,问题不再存在。我以前有4.8版本(默认情况下与VS 2019一起安装)

本文链接:https://www.f2er.com/3069932.html

大家都在问