missing assembly reference
<p>Duplicate : <a href="http://stackoverflow.com/questions/1714587/missing-assembly-reference">missing assembly reference</a></p>

<p>hi everyone
please help me </p>

<p>my Shopping.cs file is given below</p>

<pre><code>using System;
using System.Data;
using MyWebsite.Commerce;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml.Serialization;


namespace MyWebsite.Commerce
{
    [Serializable]
    public class CartItem
    {
        private int _productID;
        private string _productName;
        private string _productURL;
        private int _quantity;
        private double _price;
        private double _lineTotal;
        public void New()
        {
        }
        public void New(int ProductID, string ProductName, string ProductURL, int Quantity, double Price)
        {
            _productID = ProductID;
            _productName = ProductName;
            _productURL = ProductURL;
            _quantity = Quantity;
            _price = Price;
            _lineTotal = Quantity * Price;
        }
        public int ProductID { get; set; }
        public string ProductName { get; set; }
        public string ProductURL { get; set; }
        public int Quantity { get; set; }
        public double Price { get; set; }
        public double LineTotal { get; set; }


        [Serializable]

        public class ShoppingCart
        {
            private DateTime _dateCreated;
            private DateTime _lastUpdate;
            private List&lt;CartItem&gt; _items;
            public ShoppingCart()
            {
                if (this._items = null)
                {
                    this._items = new List&lt;CartItem&gt;();
                    this._dateCreated = DateTime.Now;
                }
            }
            public List&lt;CartItem&gt; Items
            { get; set; }
            public void Insert(int ProductID, string ProductName, string ProductURL, int Quantity, double Price)
            {
                int ItemIndex = ItemIndexOfID(ProductID);
                if (ItemIndex == -1)
                {
                    CartItem NewItem = new CartItem();
                    NewItem.ProductID = ProductID;
                    NewItem.ProductName = ProductName;
                    NewItem.ProductURL = ProductURL;
                    NewItem.Price = Price;
                    NewItem.Quantity = Quantity;
                    _items.Add(NewItem);
                }
                else
                {
                    _items[ItemIndex].Quantity += 1;
                }
                _lastUpdate = DateTime.Now;
            }

            public void Update(int RowID, int ProductID, int Quantity, double Price)
            {
                CartItem Item = _items[RowID];
                Item.ProductID = ProductID;
                Item.Quantity = Quantity;
                Item.Price = Price;
                _lastUpdate = DateTime.Now;
            }
            public void DeleteItem(int rowID)
            {
                _items.RemoveAt(rowID);
                _lastUpdate = DateTime.Now;
            }
            private int ItemIndexOfID(int ProductID)
            {
                int index = 0;
                foreach (CartItem item in _items)
                {
                    if (item.ProductID == ProductID)
                    {
                        return index;
                    }
                    index += 1;
                }
                return -1;
            }
            public double Total
            {
                get
                {
                    double t = 0;
                    if (_items == null)
                    {
                        return 0;
                    }
                    foreach (CartItem Item in _items)
                    {
                        t += Item.LineTotal;
                    }
                    return t;
                }
            }
        }

    }
}

and then i create a web user control file ShoppingCart.ascx and ShoppingCart.ascx.cs file code are given below of ShoppingCart.ascx.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using MyWebsite.Commerce;


public partial class ShoppingCart : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Profile.Cart == null)
        {
            Profile.Cart = new MyWebsite.Commerce.ShoppingCart();
        }
        if (!Page.IsPostBack)
        {
            BindGrid();
        }
        if (Profile.Cart.Items == null)
        {
            TotalLabel.Visible = false;
        }
    }
    protected void CartGrid_RowEditing(object sender, GridViewEditEventArgs e)
    {
        CartGrid.EditIndex = e.NewEditIndex;
        BindGrid();
    }
    protected void CartGrid_RowUpdating(object sender, GridViewUpdatedEventArgs e)
    {
        TextBox QuantityTextBox = (TextBox)CartGrid.Rows[e.RowIndex].Cells[2].Controls[0];
        int Quantity = Convert.ToString(QuantityTextBox.Text);
        if (Quantity == 0)
        {
            Profile.Cart.Items.RemoveAt(e.RowIndaex);
        }
        else
        {
            Profile.Cart.Items[e.RowIndex].Quantity = Quantity;
        }
        CartGrid.EditIndex = -1;
        BindGrid();
    }
    protected void CartGrid_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        CartGrid.EditIndex = -1;
        BindGrid();
    }
    protected void CartGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Profile.Cart.Items.RemoveAt(e.RowIndex);
        BindGrid();
    }

    private void BindGrid()
    {
        CartGrid.DataSource = Profile.Cart.Items;
        DataBind();
        TotalLabel.Text = string.Format("Total : {0,19:c}", Profile.Cart.Total);
    }
}
</code></pre>

<p>when i drag and drop ShoppingCart.ascx file on to ShoppingCartPage.aspx file and run the application the there is a error occurred,when i clicked the error the i go on to this below code</p>

<p>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.</p>

<blockquote>
  <p>Compiler Error Message: CS0234: The
  type or namespace name 'ShoppingCart'
  does not exist in the namespace
  'MyWebsite.Commerce' (are you missing
  an assembly reference?)</p>
  
  <p>Line 17: public class ProfileCommon :
  System.Web.Profile.ProfileBase { Line
  18:      Line 19:     public virtual
  MyWebsite.Commerce.ShoppingCart Cart {
  Line 20:         get { Line 21:<br>
  return
  ((MyWebsite.Commerce.ShoppingCart)(this.GetPropertyValue("Cart")));</p>
</blockquote>

<p>please help me..................</p>
