using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WcfServiceLibrary1
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }        private void Form3_Load(object sender, EventArgs e)
        {
            ServiceReference1.IService1 sc= new ?????????????
        }
    }
}
实例化红色的里面的对象.IService1。
 

解决方案 »

  1.   

    System.ComponentModel是名称空间,不是类,没法实例化的ServiceReference1.IService1 sc= new ServiceReference1.IService1()http://www.cnblogs.com/dongdonghuihui/archive/2009/08/27/1555086.html
      

  2.   

    I打头的一般是接口,接口是没法用new实例化的,你只能实例化这个接口的派生类,一般来说,接口都通过工厂模式实例化,你可以去查这个接口的使用说明,要么new派生类,要么用工厂创建,
      

  3.   

    IService一看就是接口啊。。接口是不能直接实例化的