Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

CodeClass.AddFunction returning a strange object

$
0
0

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:

An unhandled exception of type 'System.ArgumentException' occurred in WF2UPA.dll

Additional information: Value does not fall within the expected range.

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.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>