3 Replies Latest reply on Jul 9, 2018 2:55 AM by geeksquadsupport321

    Problems building sample code from vSphere Automation SDK 6.7...

    LumH Novice

      Hi there...

       

      Am trying to build and run the sample code in the vSphere Automation SDK 6.7 on Windows 10 Pro - to be used to interface with my vCenter 6.7 installation.

       

      I've downloaded and extracted the SDK (from GitHub).

      I didn't have .NET Framework 4.5.2 so I downloaded and installed that too.

       

      Everything was good when I loaded vSphere-Samples.sln. When I built it, only ListVMsWebApp failed to build:

      C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.CSharp.CurrentVersion.targets(448,9): error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly D:\BIV - VMWare vSphere SDK\vsphere-automation-sdk-.net-master\packages\Microsoft.Net.Compilers.2.1.0\build\..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 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.

       

      Of course, when I looked at the documentation under "Setting up build environment", I noticed "Visual Studio 2015 or higher", and I was using VS 2013.

      Would that explain the error code above?

      I looked at vCenter 6.5, and it too had the VS 2015 or higher requirement.

       

      Before this, I did the same thing with vSphere Web Services SDK, and was able to get the sample code to build and execute - it did not have that requirement.

       

      Thanks for the help!

        • 1. Re: Problems building sample code from vSphere Automation SDK 6.7...
          LumH Novice

          So... the build error has nothing to do with whether I'm using VS2013 or not.

           

          It had to do with the NuGet package - CodeDOM Providers for .NET Compiler Platform ("Roslyn").

          I had to Uninstall and Reinstall that package in order for it to build properly.

           

          Given that, even though I will be testing the code samples generated by VS2013 (i.e. not VS2015+), I would like to hear from anyone else out there who are successfully using the Automation SDK 6.7 built with VS2013 or pre-VS2015 ?

           

          Clarification:

          The "VMWare vSphere Automation SDKs Programming Guide" for 6.7, section "SDK Developer Setup", tells the user to find instructions for settings up a development environment in the README document for the SDK.

          Viewing the README.md, under section "### Setting up build environment", you'll see the statement:

          To build and run the samples, install Microsoft Visual Studio 2015 or higher.

           

           

          • 2. Re: Problems building sample code from vSphere Automation SDK 6.7...
            LumH Novice

            In the end, I was able to build the SDK in VS 2013... and did execute some of the sample code successfully.

            So I think this is just a "documentation" issue.

            • 3. Re: Problems building sample code from vSphere Automation SDK 6.7...
              geeksquadsupport321 Lurker

              Yes, that was a document issue. I have also face the same issue and then I contacted to Geek Squad and they tell me about this problem with a proper solution. It was a nice experience and you can also contact them for future problems related to vSphere.