Page 1 of 1
					
				[BUG] Extended Properties access in T4 (v4.1.41)
				Posted: Tue  13 Sep 2011 15:46
				
				I defined an Extended Property for classes in the model designer named "GenerateInterface". 
But when I try to access it in my modified ObjectContext T4 template with 
Code: Select all
cls.GetProperty("GenerateInterface");
 I get the following error: "Custom tool error: Unknown property 'GenerateInterface'."
Using 
Code: Select all
cls.GetExtendedProperties().FindProperty("GenerateInterface");
 or 
Code: Select all
cls.GetExtendedProperties().GetProperty("GenerateInterface");
results in the same error or a null reference.
But querying the collection with 
Code: Select all
cls.GetExtendedProperties().FirstOrDefault(x => x.Name == "GenerateInterface")
 as a workaround or enumerating through all Extended Properties of my class, I get/see my Extended Property. So I guess there is something wrong with the FindProperty() method.
 
			 
			
					
				
				Posted: Wed  14 Sep 2011 12:28
				by Shalex
				The developer can customize the set of properties of any element in the model by declaring extended properties in two ways:
a) in template code like:
b) in model properties: right click on diagram surface > Edit Model Settings > Model > Extended Properties, then choose the element you are interested in and add an extended property.
Have you defined your extended property in the template or in the model? If the problem persists, please 
send us your template or model correspondingly.
 
			 
			
					
				
				Posted: Wed  14 Sep 2011 15:23
				
				I defined it in the model properties, but I also tried it in the template code like it is shown in your help files. Both had the same result.
I sent you my model via the formular with a reference to this and the other bug it just reported.
			 
			
					
				
				Posted: Mon  19 Sep 2011 16:49
				by Shalex
				[email protected] wrote:I defined an Extended Property for classes in the model designer named "GenerateInterface".
But when I try to access it in my modified ObjectContext T4 template with
Code:
cls.GetProperty("GenerateInterface");
I get the following error: "Custom tool error: Unknown property 'GenerateInterface'."
 
Could you please specify the exact steps we should follow with your model using Entity Developer v 4.1.41 to reproduce "Custom tool error: Unknown property 'GenerateInterface'."? Where exactly in your template should we place the mentioned line of code?
 
			 
			
					
				
				Posted: Wed  21 Sep 2011 07:48
				
				Shalex wrote:[email protected] wrote:I defined an Extended Property for classes in the model designer named "GenerateInterface".
But when I try to access it in my modified ObjectContext T4 template with
Code:
cls.GetProperty("GenerateInterface");
I get the following error: "Custom tool error: Unknown property 'GenerateInterface'."
 
Could you please specify the exact steps we should follow with your model using Entity Developer v 4.1.41 to reproduce "Custom tool error: Unknown property 'GenerateInterface'."? Where exactly in your template should we place the mentioned line of code?
 
Everywhere where you can find my workaround code "GetExtendedProperties().FirstOrDefault".
 
			 
			
					
				
				Posted: Thu  22 Sep 2011 15:50
				by Shalex
				We cannot reproduce the problem at the moment. Please specify the regional settings of your workstation: Control Panel > Reginal and Language Options > the "Standards and formats" drop-down value, Location, and Language for non-Unicode programs.
			 
			
					
				
				Posted: Thu  22 Sep 2011 16:07
				
				Shalex wrote:We cannot reproduce the problem at the moment. Please specify the regional settings of your workstation: Control Panel > Reginal and Language Options > the "Standards and formats" drop-down value, Location, and Language for non-Unicode programs.
Everything is set to de-CH (German, Switzerland).
 
			 
			
					
				
				Posted: Wed  28 Sep 2011 13:46
				by StanislavK
				Sorry for the delay. We couldn't reproduce the issue in our environment. 
A possible cause of the problem is that a national character similar to a standard Latin symbol was accidentally used in the "GenerateInterface" constant. Please ensure that this is not the case.
Also, we've made some changes that may be related to this issue. If the problem persists, please try the new build when it is available (we plan to release it in several days) and tell us if the issue can be reproduced with it.
			 
			
					
				
				Posted: Mon  03 Oct 2011 13:19
				
				StanislavK wrote:Sorry for the delay. We couldn't reproduce the issue in our environment. 
A possible cause of the problem is that a national character similar to a standard Latin symbol was accidentally used in the "GenerateInterface" constant. Please ensure that this is not the case.
Also, we've made some changes that may be related to this issue. If the problem persists, please try the new build when it is available (we plan to release it in several days) and tell us if the issue can be reproduced with it.
The string is purely made out of ASCII 7 bit chars. But whatever, the new version fixed the problem for me.