“类型或名称空间名称"错误 [英] 'The type or namespace name' Errors

查看:73
本文介绍了“类型或名称空间名称"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下错误:-

I am getting the following errors:-

Error 3 The type or namespace name 'ServiceReference3' does not exist in the namespace 'VotingPanel2' (are you missing an assembly reference?) C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\MainPage.xaml.cs 13 20 VotingPanel2


Error 4 The type or namespace name 'ServiceReference3' does not exist in the namespace 'VotingPanel2' (are you missing an assembly reference?) C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 13 20 VotingPanel2


Error 5 The type or namespace name 'ServiceReference3' does not exist in the namespace 'VotingPanel2' (are you missing an assembly reference?) C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 37 75 VotingPanel2



让我在所有这些错误所在的位置附加文件,是否需要进一步告知我.



Let me attach file where all these error are, do let me know if need further.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using VotingPanel2.ServiceReference3;
namespace VotingPanel2
{
    public partial class CreateSurveyForm : Page
    {
        public CreateSurveyForm()
        {
            InitializeComponent();
            VotingPanel2.ServiceReference3.Service3Client client = new VotingPanel2.ServiceReference3.Service3Client();
            //client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);
           // client.CheckSurveyExistAsync();

        }
        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        void client_CheckSurveyExistCompleted(object sender, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs e)
        {
            int a;
            a = e.Result;
           // if a
         //   MessageBox.Show(e.Result.ToString ());
            
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Service3Client client = new Service3Client();
           // client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);
            client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);
            client.CheckSurveyExistAsync(this.Title.Text,this.SurveyQuestion.Text,this.Surveyoption1.Text,this.Surveyoption2.Text,this.Surveyoption3.Text ); 

           
           // Service3Client client = new Service3Client();
           
           
           //client.CheckSurveyExistAsync(this.Title.Text);
            
        }
      
    }
}

推荐答案

您是否添加了对VotingPanel2命名空间的项目引用?
Have you added a project reference to the VotingPanel2 namespace?


这是完整代码
<pre lang="msil">using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using VotingPanel2.ServiceReference3;

namespace VotingPanel2
{
    public partial class CreateSurveyForm : Page
    {
        public CreateSurveyForm()
        {
            InitializeComponent();
            VotingPanel2.ServiceReference3.Service3Client client = new VotingPanel2.ServiceReference3.Service3Client();



        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }


        void client_CheckSurveyExistCompleted(object sender, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs e)
        {


           MessageBox.Show(e.Result.ToString ());


        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {

            Service3Client client = new Service3Client();
            client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);


            client.CheckSurveyExistAsync(this.Title.Text,this.SurveyQuestion.Text,this.Surveyoption1.Text,this.Surveyoption2.Text,this.Surveyoption3.Text );



        }



    }
}






您需要在项目中添加服务引用"ServiceReference3".
You need to add the service reference ''ServiceReference3'' to your project.


这篇关于“类型或名称空间名称"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆