This is a migrated thread and some comments may be shown as answers.

Enhancer problem with same class names

0 Answers 35 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Urs
Top achievements
Rank 2
Urs asked on 14 Jun 2016, 02:03 PM

I have a project with Data Access Q3 2014 SP1 (2014.3.1209.1). The project handle db tables in 2 different databases. In both databases we use an identical table. So the class have the same name and the same table name but are in different name spaces. When I compile the project on my developer PC everything works fine. If I build the solution with TFS build agent (MSBuild), the the following error occurred at program start:

An error occurred while writing to database table 'xxxxxxx'.
The supplied instance is not of type Telerik.OpenAccess.SPI.dataobjects.PersistenceCapable (<ClassName>). Are you trying to add a wrong object or is the assembly not enhanced?

I spend a lot of time to analyze the problem and found the problem with JustDecompile (another cool tool from Telerik).

Only one class is enhanced by the enhancer.
       public class MyClass: ISerializable, PersistenceCapable

The other class is NOT enhanced by the enhancer.
       public class MyClass: ISerializable

I solved the problem by rename the classes and the table names.
Is this issue solved in newer version of DataAccess?
Exists an other workaround?

Urs


Tags
Data Access Free Edition
Asked by
Urs
Top achievements
Rank 2
Share this question
or