Print Page | Close Window

Generated Code causing Errors

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2433
Printed Date: 29-Jul-2026 at 3:08pm


Topic: Generated Code causing Errors
Posted By: jipock
Subject: Generated Code causing Errors
Date Posted: 11-Jan-2011 at 7:32am
Morning, all.
 
I am experiencing an issue when I'm running Ideablade / DevForce for Silverlight. Specifically, I"m getting a compile-time warnings similar to this:  "mynamespace.mywebservice.myobject.PropertyChanged' hides inherited member 'IdeaBlade.EntityModel.EntityWrapper.PropertyChanged'. Use the new keyword if hiding was intended."
 
Background of this: I have an application I'm converting over to DevForce for Silverlight. The previous code uses ADO.NET stored proc calls from a webservice. Now, I'm using Entity Framework, being hosted in the same web project. I still need to make WebService calls from the Silverlight project.
 
Fairly recently (within last couple of weeks), when I update the webservice reference in my Silverlight project, it appears that the myobject class's event is hiding the EntityWrapper Property changed event. To my knowledge, I've not done anything crazy in the webservice. This process *was* working fine.
 
Anyone have ideas on either a) what's causing this? b) how to troubleshoot better?



Replies:
Posted By: jipock
Date Posted: 11-Jan-2011 at 7:34am
Quick note: the compile-time warnings are just that: warnings. But, when I run the application, I get errors with the LoginReply object and can't proceed.


Posted By: DenisK
Date Posted: 12-Jan-2011 at 5:58pm
Hi jipock;

It sounds like myobject is derived from EntityModel.EntityWrapper and is using the same variable name PropertyChanged. Either change the PropertyChanged variable name or use the new keyword as the warning says. Please see Microsoft website below for more details.

http://msdn.microsoft.com/en-us/library/3s8070fc%28v=VS.100%29.aspx - http://msdn.microsoft.com/en-us/library/3s8070fc(v=VS.100).aspx


Posted By: jipock
Date Posted: 13-Jan-2011 at 6:51am
here's an example of "myobject":
 

/// <summary>The auto-generated ServiceKeyword class. </summary>

[DataContract(IsReference=true)]

[KnownType(typeof(Service))]

[IbEm.DataSourceKeyName(@"AccessNavigationEDMEntities")]

[IbEm.DefaultEntitySetName(@"AccessNavigationEDMEntities.ServiceKeywords")]

public partial class ServiceKeyword : IbEm.Entity {}

This is all generated by DevForce, I didn't write this part. There is a partial class to it, but it doesn't have anything which should cause problems.

public partial class ServiceKeyword

{

public static ServiceKeyword Create(EntityManager manager)

{

ServiceKeyword entity = manager.CreateEntity<ServiceKeyword>();

entity.CreatedBy = manager.Principal.Identity.Name;

entity.CreatedDateTime = DateTime.Now;

entity.Keyword = String.Empty;

entity.ServiceId = 0;

entity.ServiceKeywordId = 0;

entity.LastModifiedBy = manager.Principal.Identity.Name;

entity.LastModifiedDateTime = DateTime.Now;

entity.EntityAspect.AddToManager();

return entity;

}

}

Is there anything I can do to troubleshoot further?


Posted By: DenisK
Date Posted: 13-Jan-2011 at 10:55am
Hi jipock;

My guess is that the same class, ServiceKeyword, is defined in the Service Reference (for the web service). Try checking the generated Reference.cs file.


Posted By: jipock
Date Posted: 16-Jan-2011 at 6:16pm
Sorry it took so long to get back.
 
The issue here is that ServiceKeyword is an EF object. I don't ever explicitly define it.
 
More Wierdness:
* Other Co-workers do NOT have this problem at all, even pulling the same code from TFS.
* When I delete my working folder and do a fresh pull (basically making my code identical to my co-workers) I experience the same problems (that my co-workers do not).
 
My Solution:
Take my web service and put it in a completely new Project. When DevForce is in the same project as the Web Site and my Web Service is in a different service, this is no longer an issue.
 
 


Posted By: DenisK
Date Posted: 18-Jan-2011 at 5:29pm
jipock;

Thanks for sharing your solution.



Print Page | Close Window