Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Visual Studio 2012 WCF service Reference.cs在向服务添加方法后只有一个类_C#_.net_Wcf_Visual Studio_Visual Studio 2012 - Fatal编程技术网

C# Visual Studio 2012 WCF service Reference.cs在向服务添加方法后只有一个类

C# Visual Studio 2012 WCF service Reference.cs在向服务添加方法后只有一个类,c#,.net,wcf,visual-studio,visual-studio-2012,C#,.net,Wcf,Visual Studio,Visual Studio 2012,我在VS2012的4.0框架中运行了一个WCF服务。我在我的服务中添加了一个方法,突然服务引用无法在另一个项目中正确更新。Reference.cs文件中只有一个类,而不是它通常拥有的大量其他类。更新引用过程表示它已完成,并且不会给出任何错误消息 我在事件日志中发现了这一点,但并不一致: WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpReq

我在VS2012的4.0框架中运行了一个WCF服务。我在我的服务中添加了一个方法,突然服务引用无法在另一个项目中正确更新。Reference.cs文件中只有一个类,而不是它通常拥有的大量其他类。更新引用过程表示它已完成,并且不会给出任何错误消息

我在事件日志中发现了这一点,但并不一致:

    WebHost failed to process a request.
 Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/18956358
 Exception: System.Web.HttpException (0x80004005): The service '/MyCompanyService/SystemService.svc/_vti_bin/ListData.svc' does not exist. ---> System.ServiceModel.EndpointNotFoundException: The service '/MyCompanyService/SystemService.svc/_vti_bin/ListData.svc' does not exist.
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
 Process Name: WebDev.WebServer40
 Process ID: 13212
ListData不是我的服务之一,所以它几乎像是WCF中内置的东西

在尝试了很多事情之后,我发现如果我删除了一个现有的服务方法,并添加了我的新方法,它就可以正常工作了。因此,我似乎已经达到了一个极限,即一个服务可以使用多少种方法。我尝试了发布的建议,包括更改服务和devenv.config上的maxNameTableCharCount,但仍然存在问题

按照我的代码设置方式,我有一个WCF服务,它使用分部类和分部接口分解成许多文件。有趣的是,当我从其他无法解决问题的分部类中删除方法时。我必须从添加到的同一文件或分部类中删除一个方法

谢天谢地,我找到了两种不再需要的方法,但我很快就会再次遇到这种方法。很多人说方法的数量是没有限制的,这可能是真的。这可能只是对发送的XML大小的限制。但这并不能解释为什么我可以删除另一个分部类中的方法,而且没有任何效果

那么,我如何利用WCF解决这个问题呢?除了拥有多个服务或只是切换到Web API之外,还有其他选择吗

示例代码:

    public partial interface IMyCompanyService
{
    [OperationContract]
    SubmissionReturn SubmitApplication(MyCompanyAuthentication auth, MyApplication application); 

...30 other methods defined just like this one...
}
    public partial class MyCompanyService : IMyCompanyService
{
    public SubmissionReturn SubmitApplication(MyCompanyAuthentication auth, ResellerApplication application)
    {
        authentication.Authenticate(auth);
        MyApplicationBLL bll = new MyApplicationBLL();
        return bll.SubmitApplication(application);
    }
}
每个服务分部类都有以下数量的方法 服务文件A:31 服务文件B:76 服务档案C:52
服务文件D:19

ListData.svc是内置的。内置于SharePoint中SharePoint是否会在此处引发问题?这是SharePoint,所以我自然会认为它会。嗯,这是某种SP问题。确保SP站点已启动,您已通过身份验证,等等。可能尝试从浏览器访问该URL。这有一个问题。这不是SharePoint。我正在与一个DotNetNuke前端打一个WCF服务。事实上,DNN在这一点上甚至不在图片中。我只是想生成服务引用。我想知道安装的SharePoint是否给我带来了问题?请关注
/MyCompanyService/SystemService.svc/\u vti\u bin/ListData.svc
。它应该在哪里?为什么不在那里。