System.Reflection.GetProperty not available?

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
gkimirti
Posts: 2
Joined: Thu Oct 24, 2019 8:42 am

System.Reflection.GetProperty not available?

Post by gkimirti »

When I want to use this script at the 2.40 sp4 version, that message appears.
_System.Reflection.GetProperty =_ System.Reflection.GetField Functionality changed that cannot be automatically converted. Needs manual overview_

mark.monroe 's code
http://ixtalk.beijerelectronics.us/down ... php?id=521

http://ixtalk.beijerelectronics.us/view ... y&start=10

I want to use , but get runtime error.

Code: Select all

		private GlobalDataItem GetGlobalDataItem(string propertyName)
		{
			PropertyInfo tagProperty = typeof(Neo.ApplicationFramework.Generated.Tags).GetProperty(propertyName);
			if(tagProperty == null)
				return null;
			else
				return tagProperty.GetValue(Globals.Tags, null) as GlobalDataItem;         
		}

User avatar
Russ C.
Posts: 213
Joined: Thu Nov 16, 2017 3:32 pm
Contact:

Re: System.Reflection.GetProperty not available?

Post by Russ C. »

As of iX Developer 2.20 that method is no longer supported, try FieldInfo instead, see below:

Code: Select all

using Neo.ApplicationFramework.Interfaces.Tag;
using System.Reflection;

private IBasicTag GetTag(string tagName)
{
   FieldInfo tagProperty = typeof(Neo.ApplicationFramework.Generated.Tags).GetField(tagName);
   return (IBasicTag)tagProperty.GetValue(Globals.Tags);
}
Best regards,

Russ
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply