帮助 - 尝试调试WCF客户端服务 [英] HELP - Trying to Debug a WCF client service

查看:183
本文介绍了帮助 - 尝试调试WCF客户端服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在IIS中运行了Hello worldWCF服务。我在一个单独的解决方案中创建了一个客户端,该解决方案调用该服务并返回标准您输入的测试 - 效果很好。



I现在想通过调试进入服务代码。我转到我的客户端并附加到w3wp.exe但是当我接到我的服务电话时



string xxx = client.GetData(TEST );





找不到RealProxy.cs





我到处寻找但未能找到答案。感谢我能够调试在IIS中运行的简单WCF服务的任何帮助。



问候

Pat

Hello,
I have an "Hello world" WCF Service running in IIS. I have created a client in a separate solution which calls the service and returns the Standard "You Entered TEST" - works great.

I now want to step into the Service code via debug. I go to my client and attach to w3wp.exe but when I get to my call to the service

string xxx = client.GetData("TEST");


RealProxy.cs not found


I have looked everywhere but failed to find an answer to this. Appreciate any help I can get to be able to debug a simple WCF service running in IIS.

regards
Pat

推荐答案

嗨Rajat。



我在服务器和放大器中都有以下指定的引用。客户解决方案:



系统

Ssystem.Net

System.Runtime.Remoting

System.Runtime.Serialization

System.ServiceModel



但仍然得到相同的RealProxy.cs错误(见下文)



找到'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'的来源。 (没有校验和。)

文件'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'没有存在。

在脚本文档中查找'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'.. 。

查看'f:\dd\NDP \ clr \src \ BCL \ System \ Runtime \Remoting\RealProxy.cs'的项目。 />
在项目中找不到该文件。

查看目录'C:\Program Files(x86)\ Microsoft Visual Studio 12.0\VC\crt\ src \'...

查看目录'C:\Program Files(x86)\ Microsoft Visual Studio 12.0\VC\crt\src\vccorlib\'。 ..

查看目录'C:\Program Files(x86)\ Mysoftoft Visual Studio 12.0 \ VC \ atmfc \ src \ mfc \'...

查看目录'C:\Program Fil es(x86)\ Microsoft Visual Studio 12.0\VC\atlmfc\src\atl\'...

查看目录'C:\Program Files(x86)\\ \\ Microsoft Visual Studio 12.0\VC \ atlffc \ include...

活动解决方案的调试源文件设置表明调试器不会要求用户查找文件:f :\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs。

调试器找不到源文件'f: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\以下是我的客户



Hi Rajat.

I have references to the following specified in both server & client solutions:

System
Ssystem.Net
System.Runtime.Remoting
System.Runtime.Serialization
System.ServiceModel

But still getting the same RealProxy.cs error (see below)

Locating source for 'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'. (No checksum.)
The file 'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs' does not exist.
Looking in script documents for 'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'...
Looking in the projects for 'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src\vccorlib\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs.
The debugger could not locate the source file 'f:\dd\NDP\clr\src\BCL\System\Runtime\Remoting\RealProxy.cs'.

Below is my Client

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.ServiceModel;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

                ServiceReference2.Service1Client client = new ServiceReference2.Service1Client();
                string xxx = client.GetData("TEST123");


        }
    }
}







这是我的服务器代码






Here is my Server code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfServiceLibrary7
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class Service1 : IService1
    {
        public string GetData(string value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }
    }
}







如你所见它只是一个标准的wcf客户端/服务器。但每次我附加处理并按F11上



字符串xxx = client.GetData('TEST123')



我收到RealProxy.cs错误。有什么明显我做错了吗?



问候

Pat




As you can see it is just a standard wcf client/server. But each time I attach to process and press F11 on

string xxx = client.GetData('TEST123')

I get the RealProxy.cs error.Is there anything obvious that I am doing wrong ?

regards
Pat


这篇关于帮助 - 尝试调试WCF客户端服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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