Problem loading vix.dll - dll

I am using the VMWare Tasks library to try and automate some VMs for testing. However when my C# program (32-bit) tries to load vix.dll it seems to fail. Running vmrun.exe from the VixCOM directory works.
vmrun.exe
In procmon I can see vmrun.exe try to load winmm.dll, oleacc.dll, mpr.dll, msasn1.dll, winspool.drv in C:\Program Files (x86)\VMware\VMware VIX\VIServer-2.0.0\32bit\ which all fail. It then continues on to load other DLLs and runs ok.
And the vmware-vixWrapper.log for vmrun.exe looks like this:
Jul 30 12:16:14.802: app| Log for VixWrapper pid=3460 version=1 build=build-156745 option=Release
Jul 30 12:16:14.812: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.813: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.814: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.814: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.823: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws-2\32bit\vix.dll'
Jul 30 12:16:14.827: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.827: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.828: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.828: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:14.832: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws-2\32bit\vix.dll'
Jul 30 12:16:14.833: app| Loading Vix implementation library C:\Program Files (x86)\VMware\VMware VIX\\VIServer-2.0.0\32bit\vix.dll
C#
My program also attempts to load these DLLs in C:\Program Files (x86)\VMware\VMware VIX\VIServer-2.0.0\32bit\, fails and then continues on to load them in C:\Windows\SysWOW64.
The vmware-vixWrapper.log file looks like this for my program:
Jul 30 12:16:38.631: app| Log for VixWrapper pid=5844 version=1 build=build-156745 option=Release
Jul 30 12:16:38.636: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.637: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.637: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.639: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.647: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws-2\32bit\vix.dll'
Jul 30 12:16:38.651: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.651: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.655: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.656: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws_server_esx-4\32bit\vix.dll'
Jul 30 12:16:38.659: app| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX\\ws-2\32bit\vix.dll'
Jul 30 12:16:38.660: app| Loading Vix implementation library C:\Program Files (x86)\VMware\VMware VIX\\VIServer-2.0.0\32bit\vix.dll
Jul 30 12:16:38.669: app| failed to load library C:\Program Files (x86)\VMware\VMware VIX\\VIServer-2.0.0\32bit\vix.dll (193)
Jul 30 12:16:38.669: app| No Vix library found for provider 10 revision -1
Any help would be appreciated! :)
Here is the question on the VIX API forum.

Possibly a bug in VixCOM. Post this to the VixCOM community.
http://communities.vmware.com/community/developer/automationapi

This seems to have been caused by the VMWareTask 'Version.dll' which was getting loaded instead of 'C:\Windows\System32\version.dll'. I'm not sure of the details but once I deleted the VMWareTasks dll everything started working again.

Related

AWS CodeBuild. Could not load SDK Resolver

I've got a CodeBuild project that builds on an AWS Windows container (not a custom container), and I've started getting the following error when the app tries to build. Nothing has changed in my setup. It sounds like an issue with the build container, which as far as I know I don't have access to, and can't really do anything about? Has anyone come across this error before?
Error MSB4247: Could not load SDK Resolver. A manifest file exists,
but the path to the SDK Resolver DLL file could not be found. Manifest
file path 'C:\Program Files (x86)\Microsoft Visual
Studio\2017\BuildTools\MSBuild\15.0\bin\SdkResolvers\Microsoft.Build.NuGetSdkResolver\Microsoft.Build.NuGetSdkResolver.xml'.
SDK resolver path: C:\Program Files (x86)\Microsoft Visual
Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\NuGet\Microsoft.Build.NuGetSdkResolver.dll

Microsoft.Build.CPPTasks.Common cannot find Microsoft.Build.Tasks.Core

I just upgraded a project from Visual C++ 2012 to Visual C++ 2017 and I'm getting build failures from MSBuild:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\src\my-project.vcxproj]
The Fusion log shows bad things:
*** Assembly Binder Log Entry (2/12/2018 # 1:44:29 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = msbuild.exe
Calling assembly : Microsoft.Build.CPPTasks.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core.EXE.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.EXE.
LOG: All probing URLs attempted and failed.
Just posted this at Visual Studio Community but in another almost identical bug report they closed it as "Not a Bug" for reasons I cannot comprehend. I'm hoping StackOverflow will be more helpful. :)
Microsoft.Build.CPPTasks.Common cannot find Microsoft.Build.Tasks.Core
It seems you are using the old MSBuild.exe from .NET framework. You should use the MSBuild.exe from following location after you upgraded your project from VS2012 to VS2017:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
That because MSBuild is now part of Visual Studio!:
Starting with Visual Studio 2013, the 2013 version of MSBuild will
ship as a part of Visual Studio instead of the .NET Framework. This
transition allows us to more rapidly evolve MSBuild.
Hope this helps.
You will have to edit the file in this directory:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets
Called:
Microsoft.Cpp.Clang.targets
Edit line 17 into:
<UsingTask TaskName="ClangCompile" AssemblyFile="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll"/>
Be warned if this does create additional problems you might need to install proper MSBuild.

CA0053 unable to load rule assembly rules.dll VS 2017

How to resolve this error
CA0053 CA0053 : Unable to load rule assembly 'c:\program files (x86)\microsoft visual studio\2017\enterprise\team tools\static analysis tools\fxcop\rules\rules.dll':
Could not load file or assembly 'file:///c:\program files (x86)\microsoft visual studio\2017\enterprise\team tools\static analysis tools\fxcop\rules\rules.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
Tried to remove these tags from the project file, these tags doesn't exist in project file.
<CodeAnalysisRuleDirectories>…</CodeAnalysisRuleDirectories>
<CodeAnalysisRuleSetDirectories>…</CodeAnalysisRuleSetDirectories>
any other way of fixing this issue

MSBuild.Community.Tasks issue with vs2017

Folks I've a set of services first created in 2012, which - down the years - have seamlessly built with Vs2010, Vs2013 & Vs2015.
When I try to build with Vs2017 I get
The MSBuild.Community.Tasks.Attrib task could not be loaded from the assembly
The assembly lives under the C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\MSBuildCommunityTasks folder, however there is no MSBuildCommunityTasks folder under the \2017\Professional\MSBuild folder.
Here's the full error
C:\working\MySolution\build\Build.proj" (default target) (1) ->
(SetAssemblyVersion target) ->
C:\working\MySolution\build\Build.proj(100,5): error MSB4062: The "MSBuild.Community.Tasks.Attrib" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll.
Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll' or one of its dependencies.
The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
What changed between Vs2015 and Vs2017?
What do I need to do to fix this?
Explicitly setting the MSBuildCommunityTasksPath property gets past the problem.
I do this at the top of my build.proj file.
(For historic reasons we keep the community build tasks in our repo, which is why it's set to a location under trunk)
<MSBuildCommunityTasksPath>$(trunk)\Ref\Build\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
The extensions are most likely installed in 'C:\Program Files (x86)\MSBuild'. So I currently set the variable explicitly in my proj as a workaround.
<MSBuildExtensionsPath>C:\Program Files (x86)\MSBuild</MSBuildExtensionsPath>
Installing .Net Framework 3.5 development tools in VS2017 individual components section fixed my build.

Visual Studio 2015/Windows 10 SDK SignTool.exe bug?

I have a project that I'm upgrading to Visual Studio 2015 but it's still targeting .NET 4.5.1.
Whenever $(WindowsSDKBinPath) is set to the Windows 10 SDK "C:\Program Files (x86)\Windows Kits\10\bin\x86\" the signtool.exe exits with exit code 255 and the output cuts off like the following:
The following certificate was selected:
Issued to: XXXX
Issued by: VeriSign Class 3 Code Signing 2010 CA
Expires: Tue Apr 11 19:59:59 2017
SHA1 hash: XXXX
Done Adding Additional Store
Usually an error would show up right here if there was going to be an error but that's it, it's cuts off right here and exits with exit code 255.
If $(WindowsSDKBinPath) is set to the Windows 8.1 SDK "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\" then everything is fine. SignTool.exe signs the dll without any issues and exits with code 0 like normal.
Can anyone help me figure out how to use the newer signtool or at least know why it's not working? Below is the target I added to my csproj file to get it to sign after building. Thanks.
<Target Name="AuthenticodeProjectSign" AfterTargets="AfterBuild">
<PropertyGroup>
<AuthenticodeTimestampServerUrl>http://timestamp.verisign.com/scripts/timstamp.dll</AuthenticodeTimestampServerUrl>
<TargetAssembly>$(OutDir)$(TargetFileName)</TargetAssembly>
</PropertyGroup>
<Exec Command=""$(WindowsSDKBinPath)signtool.exe" sign /v /sha1 $(AuthenticodeCertificateSHA1) /t $(AuthenticodeTimestampServerUrl) "$(TargetAssembly)"" />
</Target>
signtool # my Machine and on the buildserver is working. On VisualStudio 2015 and Windows 10 Enterprise 64bit, I had to add the ClickOnce Publishing Tools in VisualStudio Setup:
After this you find signtool.exe in
c:\Program Files (x86)\Windows Kits\8.1\bin\x64\
c:\Program Files (x86)\Windows Kits\8.1\bin\x86\
c:\Program Files (x86)\Windows Kits\8.1\bin\arm\
I ran into the same problem where signtool exits with exit code 255 when using :
C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe
But somehow it works fine using :
C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe