Task could not find "AxImp.exe" when building project on Visual Studio Mac - mono

I have a .net project that was built on Visual Studio PC and now I'm trying to build the project on my Mac version of Visual Studio but the project will not build.
I've reinstalled VC Mac and also installed dotnet-sdk-2.2.107-osx-x64 as well as MonoFramework-MDK-5.20.1.19.macos10.xamarin.universal
This is build error I get.
/Library/Frameworks/Mono.framework/Versions/5.20.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5):
Error MSB3086: Task could not find "AxImp.exe" using the SdkToolsPath
"/Library/Frameworks/Mono.framework/Versions/5.20.1/lib/mono/4.5/" or
the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\NETFXSDK\4.7.2\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 (MSB3086)

Related

Brand new CLR Class Library project won't build: missing MSCOREE.lib

Using the latest Visual Studio 2019 version, a brand new project will not build:
fatal error LNK1104: cannot open file 'MSCOREE.lib'
I have tried to re-install Visual Studio but that didn't change anything unfortunately.
These components have been selected by the installer but apparently it's not enough:
MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.24)
Windows 10 SDK (10.0.18362.0)
C++/CLI support for v142 build tools (14.24)
Question:
Are there any tricks to get CLR Class Library (.NET Framework) projects to build ?
Here is the solution:
Apparently, no matter what framework version you will target, the $(NETFXKitsDir)Lib\um\x86 macro will always point to C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x86.
Now here's the problem, even though you install 4.7.2 SDK in Visual Studio Installer, this file is nowhere to be seen.
But if you download .NET Framework 4.7.2 Developer Pack Offline Installer and press the Repair button, it gets correctly installed and a brand new project will build succesfully.
Alternatively:
Re-installing VS also fixes the issue ...

TFS build agent cannot find AXImp.exe

TFS build agent using MSBuild 14.0 fails with "Error MSB3091: Task failed because "AxImp.exe" was not found", while the SDK is installed and AxImp.exe is present.
The error states that it cannot find the file in the bin beneath "the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86"
There is no "Microsoft SDKs" node at that location, however it does exist under Wow6432Node: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\NETFXSDK\4.6.2\
This node contains references to locations for both WinSDK-NetFx40Tools-x86 and WinSDK-NetFx40Tools-x64.
Is MSBuild looking in the wrong registry location?
Can I configure the build to make it locate either
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools
or
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\x64
to find AxImp.exe and whatever else it expects from the SDK?
Background:
Our development has so far been built on Windows 10, Visual Studio 2017, targeting .Net Framework 4.6.2. I am now trying to automate builds on Windows Server 2012 R2 Standard.
I have installed Microsoft Build Tools 2015, Microsoft .Net Framework 4.6.2 SDK, .Net Framework 4.6.2 Targeting Pack and .Net Framework 4.6.2 Targeting Pack (ENU).
Have successfully created a build agent and get an almost successful build, after chasing down a number of missing dependencies.
TFS build agent cannot find AXImp.exe
(According to the error messages, they are all common errors. we could not give the most direct correct answer for this issue, we can only give you some troubleshootings. In order to avoid losing contact in the round-trip comments, I post those troubleshootings as answer instead of comments.)
Make sure using the MSBuild task instead of Visual Studio build task in the build definition.
Using MSBuild 14.0 (C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe) rather than 4.0 (C:\Windows\Microsoft.NET\Framework\v4.0.30319) in the MSBuild task, if you build the project with Visual Studio 2015.
Check if the ToolsVersion of the Project node is 14.0 not 4.0:
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Install the Visual Studio 2015 on your build server.
Manually change the above registry key to the correct location, where AXImp.exe exists.
If all above not help you, please share the configuration of MSBuild task definition, the software you have installed on the build agent and try to build the project with Visual Studio 2015 on the build server.
Hope this helps.

Microsoft.VisualStudio.Tools.Office.targets missing

I am installing a build agent on a virtual machine (using GoCD) and my goal is trying to keep it as light as possible, i.e., installing only MSBuild and avoid installing visual studio.
One of my projects uses OfficeTools and when compiling the build I get the following error:
C:\GoAgent1\pipelines\ProjectRepo\Office\MyProject.Office.Excel2007.UnderwritingNotes\MyProject.Office.Excel2007.UnderwritingNotes.csproj(365,3):
error MSB4019: The imported project "C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
OfficeTools\Microsoft.VisualStudio.Tools.Office.targets doesn't exist!
For that I will need to install "Office Tools for Visual Studio" which depends on Visual Studio (in this case VS2015 or 14.0).
One solution is copying this folder from my development machine but is sounds a bit messy!
So I was wondering if there are standalone versions that I can plug into MSBuild without installing Visual Studio. Any suggestion?

Visual Studio 2015 Build Tools missing DNX

I've installed Visual Studio 2015 Build Tools onto our TeamCity server but the DNX folder is missing from within its installation root.
MSBuild 14 won't build an xproj because it imports Microsoft.DNX.targets
I've installed the latest DNX via the DNVM but it didn't create the DNX folder I was hoping it would.
The folder is obviously there on my dev box with VS2015 installed. I guess I could install the VS Community Edition, but why would the build tools be missing a crucial component??
Right now the DNX MSBuild targets are only installed with Visual Studio 2015 (specifically the Web Development Tools component).
https://github.com/aspnet/dnx/issues/2207#issuecomment-120076364
So it looks like I'll have to install Visual Studio 2015 Community Edition on the build server.
People are saying I should be using dnu from the command line, but the issue is that I need to make an MSDeploy package, and AFAIK, only MSBuild can do this.
Looks like I need to read this.
http://docs.asp.net/en/latest/publishing/iis.html

WIX And NAnt : Unable to build WIX source code

I am trying my hands on source code of WIX 3.6 to debug something as well as learn something.
On executing make.bat (present in root folder of WIX source) file, first i got NAnt not found. So I downloaded NAnt and updated make.bat file. On executing the file again I am getting this error
NAnt 0.91 (Build 0.91.3881.0; alpha2; 8/17/2010)
Copyright (C) 2001-2010 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///D:/wix36-sources/wix.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: inc
[readregistry] Registry Path Not Found! - key='Software\Microsoft\VisualStudio\VSIP\10.0\';hive='Microsoft.Win32.RegistryHive[]';
[readregistry] Registry Path Not Found! - key='Software\Microsoft\VisualStudio\VSIP\10.0\';hive='Microsoft.Win32.RegistryHive[]';
[property] Target framework changed to "Microsoft .NET Framework 2.0".
[property] Read-only property "dir.hhw" cannot be overwritten.
[property] Read-only property "hhw-found" cannot be overwritten.
BUILD FAILED - 2 non-fatal error(s), 2 warning(s)
D:\wix36-sources\wix.build(65,4):
Build file 'D:\wix36-sources\test\wixtests.build' does not exist.
I have .Net framework 4.0 installed on my local. Also I searched through registry for the registry key mentioned in the error and didn't found. Am I using right version of NAnt?
Do you have all of the prerequisites as described in the documentation?
In order to fully build WiX, you must have the following Frameworks and SDKs installed:
NAnt (0.90 or later)
The following components from the Windows SDK for Windows Server 2008 and .NET Framework 3.5, Visual Studio 2008, Microsoft Windows 7 SDK, and/or Visual Studio 2010:
x86 and x64 compilers, headers and libraries
IA64 headers and libraries are optional, but they are necessary for IA64 custom action support
If you want to be able to build optimized IA64 binaries, you'll need both the Windows SDK for Windows Server 2008 and .NET Framework 3.5 SDK AND Visual Studio 2008 installed; or the Microsoft Windows 7 SDK AND Visual Studio 2010.
HTML Help SDK 1.4 or higher [installed to Program Files or Program Files (x86)]
The missing registry key seems to be related to the VisualStudio SDK - you don't need this for basic WiX.
If you have all of the prerequisites, try passing the -debug switch to Nant for more detailed debugging output.
To solve this problem:
[readregistry] Registry Path Not Found! - key='Software\Microsoft\VisualStudio\VSIP\10.0\';hive='Microsoft.Win32.RegistryHive[]';
[readregistry] Registry Path Not Found! - key='Software\Microsoft\VisualStudio\VSIP\10.0\';hive='Microsoft.Win32.RegistryHive[]';
If you used Visual Studio 2010 SP1 you need Visual Studio 2010 SP1 SDK