Domain Service Issue

606
1
08-25-2011 01:55 PM
IgressT
New Contributor II
Hi,
I am following this http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlig...
post about sending geometry from Silverlight to server. Instead of usind Silverlight Enabled WCF service I am using RIA services and created a DomainService class on the server. I added WPF build of the ESRI.ArcGIS.Client.dll assembly. My domain service class looks like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;

namespace WebMVC.TestSilverlightHost.Services
{

    // TODO: Create methods containing your application logic.
    [EnableClientAccess()]
    public class PropertyBoundaryDomainService : DomainService
    {
        public bool SaveGraphics(IEnumerable<ESRI.ArcGIS.Client.Graphic> GraphicCollection)
        {
            return false;
        }
    }
}


When I compile my application it gives me this error
"The Complex Type 'ESRI.ArcGIS.Client.Graphic' already exists in another assembly. Complex Types cannot be defined in multiple assemblies."

I think this error occurs due to the Generated Code that is generated by the RIA services on the Silverlight end. Is there any other reason for this?

I am assuming this cannot be done using DomainServices. Can someone shed some light on this.
0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor
Make sure you add the Silverlight ESRI.ArcGIS.Client.dll to your Silverlight project BEFORE you add a reference to the domain service. Doing that, it should pick up the types in the assembly, instead of creating its own.
0 Kudos