This project is read-only.
2
Vote

Initializing a build failed: Type 'VirtualMachinePowerState' is not defined

description

Hello,

I'm trying to integrate TFS 2012 with VMwareLab and expirience problem with running build. It failed on initialazing step:
TF215097: An error occurred while initializing a build for build definition \TFS_VMware_POC\2012 VMware Lab: The root element of the build process template found at $/TFS_VMware_POC/BuildProcessTemplates/VMWareLabDefaultTemplate.xaml (version C60) is not valid. (The build process failed validation. Details: 
Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vmPowerState <> VirtualMachinePowerState.poweredOn".
Type 'VirtualMachinePowerState' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vmPowerState".
Type 'VirtualMachinePowerState' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vMWareConnection".
Type 'VimClient' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vMWareConnection".
Type 'VimClient' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vmPowerState <> VirtualMachinePowerState.poweredOn".
Type 'VirtualMachinePowerState' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vmPowerState".
Type 'VirtualMachinePowerState' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vMWareConnection".
Type 'VimClient' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "FoundVirtualMachine".
Type 'VirtualMachine' is not defined.

Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "vMWareConnection".
Type 'VimClient' is not defined.

)
Environment: VS2012, TSF2012, PowerCLI 5.0.

I followed your documentation to install VMwareLab and didn't have any problem with it. However I can't open VMWareLabDefaultTemplate.xaml in VS. It returns the error:
System.Xaml.XamlException: 'The type ‘InArgument(v:VMWareLabWorkflowDetails)’ of property ‘VMWareLabWorkflowParameters’ could not be resolved.' Line number '35' and line position '52'.
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.BufferedPropertyList.ActivityPropertyHolder..ctor(DynamicActivityXamlReader parent, XamlReader reader)
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.BufferedPropertyList.BufferDefinitions(DynamicActivityXamlReader parent)
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.ProcessCurrentNode()
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.Read()
   at Microsoft.Activities.Presentation.Xaml.ActivityTemplateFactoryBuilderReader.Read()
   at Microsoft.Activities.Presentation.Xaml.ViewStateXamlHelper.StripViewStateElement(XamlReader inputReader, Dictionary`2& viewStateInfo, Dictionary`2& viewStateSourceLocationMap)
   at Microsoft.Activities.Presentation.Xaml.ViewStateXamlHelper.ConvertViewStateToAttachedProperties(XamlReader inputReader, ViewStateIdManager idManager, Dictionary`2& viewStateSourceLocationMap)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, DeserializationMode mode, IList`1& loadErrors, Dictionary`2& sourceLocations)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, IList`1& loadErrors, Dictionary`2& sourceLocations)
   at System.Activities.Presentation.WorkflowDesigner.Load()

Build server with build agent and VM for deploying app are up and running.

Thank you,
Mykola

file attachments

comments

mbinder wrote Jan 18, 2013 at 10:10 AM

Hello Mykola,

it seems like the build can’t find the custom assemblies. Please make sure that you added the assemblies to the source control and set the right path for the “Version control path to custom assemblies” in the build controller properties. The steps are described in the documentation.

To open the VMWareLabDefaultTemplate.xaml in Visual Studio you need to add a reference to the VMWareLabWorkflowsDataContracts.dll assembly.
I Hope this is going to help you.

Regards,
Markus

mshenhera wrote Jan 18, 2013 at 8:44 PM

Thanks Markus,

I readded assemblies once again and it started working.

wrote Feb 13, 2013 at 11:20 PM

siyo_wang wrote May 10, 2013 at 7:07 AM

I tried it in the TFS2010 with VS2010, but I also get the above error.
I have reset "Version Control path to custom assemblies" several time.

Swubu wrote May 22, 2013 at 1:10 PM

Hello Guys,

I also have the same error.

I readded the assemblies to the version control and set the custom assemblies path again.
The build service is running.

My Environment:
TFS2010; VS2010; PowerCLI 5.1.0

Can anyone help?


Regards,
Sven

wrote May 22, 2013 at 1:13 PM

mbinder wrote Jun 4, 2013 at 3:24 PM

Hello,

can you please chek if all the assemblies form the custom assemblies path are downloaded to the machine running the build controller?
The default path on the controller should be "c:\Users\AccountName\AppData\Local\Temp\BuildController\".

Regards,
Markus

Swubu wrote Jun 4, 2013 at 4:13 PM

Hello Markus,

I checked the path.
The folder contains all files (11 items) for TFS2010.

Regards,
Sven

wrote Jun 4, 2013 at 4:16 PM

Swubu wrote Jun 4, 2013 at 4:16 PM

Screenshot from Temp-Folder

Gesu wrote Jun 7, 2013 at 12:29 PM

Hello,

We have the same problem with the environment: Environment: VS2012, TSF2012, PowerCLI 5.1.
The custom assemblies are not downloaded to the machine running the build controller!

Can anyone help?

Regards,
Urs

mbinder wrote Jun 11, 2013 at 9:17 AM

Please make sure you have the VMware vSphere PowerCLI installed on the Build Controller.
http://communities.vmware.com/community/vmtn/automationtools/powercli

Regards,
Markus

Gesu wrote Jun 12, 2013 at 2:40 PM

I have reinstalled the VMware vSphere PowerCLI on the Build Controller the same error is occurred.

Regards,
Urs

japjOce wrote Oct 31, 2013 at 2:42 PM

Hi,

I seems you also need to install the System.Web.Services 2.0 assembly (which is part of asp.net).

However that did not solve the problem for me either.
We have a build controller with VS2012/W2012 64bit, PowerCLI 5.1 connected to TFS2012.

If I edit the build definition on my personal pc and edit the vmware details I get an "Object reference not set to an instance of an object" popup dialog (with ok). Then I get the VMWare Lab Workflow Parameters wizard that still shows all the correct settings as I've specified them during the initial setup of the build definition.

Best regards,

Jeroen

wrote Jul 11, 2014 at 3:41 PM

bugmenot2 wrote Jul 11, 2014 at 3:41 PM

Hi,
We plan to use this library in our multinational company, but I also have the same error.
After two days of research and tests, I found out that the VMWare Vim library is compiled on .NET Framework 2.0, and that's cause the problem.

Indeed, I've made a very minimalist build workflow that does not use the activities provided here, but only declare one variable and assign it with a new VMWare.Vim.VimClient object (see file VMWareLabTestTemplate.xaml attached). And with this workflow, I also get a similar error :
The build process failed validation. Details: Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "New VMware.Vim.VimClient()". 'New' cannot be used on an interface.
So I think that when you import VMware.Vim in a workflow, TFS is not able to resolve the dependencies because they do not targetting the version 4.0 of the framework.

The solution I've found is to wrap all classes used by the activities in a assembly compiled with the .NET Framework 4.0, and only use these wrappers in the build workflow so that I can remove the import of VMware.Vim in the workflow. Not very pretty, maybe a better solution exists ?

My Environment:
TFS2010; VS2010; PowerCLI 5.1.0;TFS, Build Controllers & Agents on Windows Server 2008

Regards