So we are trying to migrate WPF project from VS 2017 to VS2019. The target framework version is set to 4.7.2 but the COMreference we added search for latest .NET tools 4.8 and it fails with below error. Based on my research from, it seems even when the target framework version is set the application runs with latest version. Is there any way to use the lower version? (Since my dependency in other project is not compatible with the latest one I need to use lower version)
Note: I renamed NETFX 4.8 Tools to NETFX 4.8 Tools_ to avoid using this particular toolset to prevent compilation error from other dependency version mismatch.
"Task could not find "AxImp.exe" using the SdkToolsPath "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.8\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed"
CodePudding user response:
Sounds like the project build configuration was changed to target 64-bit arch. This is a not uncommon, but rather obscure cause that is prone to lead to these types of compilation errors especially when dealing with COM libraries that were designed for, and with build tooling specific to x86.
Change your target build architecture back to 32-bit (not 64-bit or "any processor") and it should resolve itself. Your .NET version is unrelated in this case.
Addendum: If my recommendation above doesn't fix it, you may be encountering a similar issue to the one described in this thread.