I am developing a plugin that converts project types.
At one point in the plug in, I need to copy the methods from one class to another:
// Assuming element is passed to the method as CodeFunction
CodeFunction func = (CodeFunction)element;
fullName = func.FullName;
name = fullName.Split('.').Last();
fullType = func.Type.AsString;
CodeFunction functionVar = newCode.AddFunction(name, func.FunctionKind, func.Type, -1, func.Access);
However, whenever I try to access any of the methods or properties of functionVar, I get the following error:
I am trying to do this in Visual Studio Enterprise 2015 on Windows 10, however, if I run the same code in Visual Studio Premium 2013 on Windows 7, everything works.An unhandled exception of type 'System.ArgumentException' occurred in WF2UPA.dll
Additional information: Value does not fall within the expected range.