0

I've added a client side property to one of my ria services entities, but for some reason it's giving me the warning "the type "OLG.Entities.ViewList" in "....cs" conflicts with the imported type "OLG.Entities.ViewList" in "....dll"

Now I understand what the error message means, but why would it conflict instead of merging the class?

My Client Side Partial Class:

namespace OLG.Entities
{
public partial class ViewList : Entity
{
    private bool _isSelected;

    /// <summary>
    /// This is used to add a client side property to the Ria Entity that will not be used on the model side (database)
    /// </summary>
    public bool IsSelected
    {
        get { return _isSelected; }
        set { 
            if (_isSelected != value) 
            { 
                _isSelected = value;
                this.RaisePropertyChanged("IsSelected");
            } 
        }
    }
}

As a side note the generated class is not in the same silverlight project as the new partial class

TBohnen.jnr
  • 5,117
  • 1
  • 19
  • 26

1 Answers1

1

As mentioned here:

You cannot have two partial classes referring to the same class in two different assemblies (projects). Once the assembly is compiled, the meta-data is baked in, and your classes are no longer partial. Partial classes allows you to split the definition of the same class into two files.

So, the cause of the error is in fact that

the generated class is not in the same silverlight project as the new partial class

Community
  • 1
  • 1
Vincent Vancalbergh
  • 3,267
  • 2
  • 22
  • 25