TFS 2012 build template: Unable to set Environment variable with "InvokeMethod" activity

123 Views Asked by At

I have custom build template for my TFS 2012 Server build. I added a "InvokeMethod" activity to set an environment variable (editing it with Visual Studio 2012), but I keep getting the error

'Environment' does not have a public static method named 'SetEnvironmentVariable ' matching the parameter types, generic type arguments, and generic type constraints supplied to InvokeMethod 'SetEnvironmentVariable '.

According to MSDN there is a static method (from System.Environment)

public static void SetEnvironmentVariable(
    string variable,
    string value
)

The InvokeMethod activity is configured as follows:

enter image description here

The activity's properties:

enter image description here

The parameter list:

enter image description here

The GenericTypeArguments collection is empty:

enter image description here

I have no clue why the InvokeMethod activiy does not accept my setup.

1

There are 1 best solutions below

0
user2516186 On BEST ANSWER

I removed and re-added the InvokeMethod activity, reset all values described above, and now the error disappeared. Seems like VisualStudio got stuck in some invalid state.