title: Cannot serialize member of type System.ComponentModel.ISite
body: <p>I am trying to run vector.asmx in web browser and getting the following error. What is the problem?</p>
  
  <p>Cannot serialize member System.ComponentModel.MarshalByValueComponent.Site of type System.ComponentModel.ISite because it is an interface.</p>
  
  <p>[my code]</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Services;
  
  namespace WebApplication2
  {
      /// &lt;summary&gt;
      /// Summary description for Vector
      /// &lt;/summary&gt;
      [WebService(Namespace = "http://tempuri.org/")]
      [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
      [System.ComponentModel.ToolboxItem(false)]
      // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
      // [System.Web.Script.Services.ScriptService]
      public class Vector : System.Web.Services.WebService
      {
  
          public double X { get; set; }
  
          public double Y { get; set; }
  
          public double Z { get; set; }
  
  
  
  
  
          [WebMethod]
          public double MagnitudeSquared()
          {
              return X * X + Y * Y + Z * Z;
          }
  
  
          [WebMethod]
          public double Magnitude()
          {
              return Math.Sqrt(MagnitudeSquared());
          }
  
          [WebMethod]
          public static Vector operator -(Vector v1, Vector v2)
          {
              Vector result = new Vector();
  
              result.X = v1.X - v2.X;
              result.Y = v1.Y - v2.Y;
              result.Z = v1.Z - v2.Z;
  
              return result;
          }
  
          [WebMethod]
          public static Vector operator +(Vector v1, Vector v2)
          {
              Vector result = new Vector();
  
              result.X = v1.X + v2.X;
              result.Y = v1.Y + v2.Y;
              result.Z = v1.Z + v2.Z;
  
              return result;
          }
  
  
          [WebMethod]
          public static Vector operator *(Vector v1, double factor)
          {
              Vector result = new Vector();
  
              result.X = v1.X * factor;
              result.Y = v1.Y * factor;
              result.Z = v1.Z * factor;
  
              return result;
          }
  
          [WebMethod]
          public Vector Clone()
          {
              Vector result = new Vector();
  
              result.X = this.X;
              result.Y = this.Y;
              result.Z = this.Z;
  
              return result;
          }
      }
  }
  </code></pre>