标签: service-reference

Visual Studio 无法删除服务引用

我正在使用 vs2013 和 vs2015 并且无法删除服务引用:

在此处输入图片说明

正常的右键单击然后删除显示完成工作(或选择时键盘上的删除键)但我得到:

在此处输入图片说明

由于以下问题,无法删除服务引用的配置:为 system.serviceModel/bindings 创建配置节处理程序时出错:AssemblyResolveEvent 处理程序无法返回仅为反射加载的程序集。

这是我的 web.config 的一部分(第 249 行及更多)

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="PayPalAPISoapBinding">
      <security mode="Transport" />
    </binding>
    <binding name="PayPalAPIAASoapBinding">
      <security mode="Transport" />
    </binding>
    <binding name="PayPalAPISoapBinding1" />
    <binding name="PayPalAPIAASoapBinding1" />
    <binding name="PayPalAPISoapBinding2">
      <security mode="Transport" />
    </binding>
    <binding name="PayPalAPIAASoapBinding2">
      <security mode="Transport" />
    </binding>
    <binding name="PayPalAPISoapBinding3" />
    <binding name="PayPalAPIAASoapBinding3" />
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="https://api.sandbox.paypal.com/2.0/" binding="basicHttpBinding" bindingConfiguration="PayPalAPISoapBinding" contract="PayPalSvc.PayPalAPIInterface" name="PayPalAPI" />
  <endpoint address="https://api-aa.sandbox.paypal.com/2.0/" binding="basicHttpBinding" bindingConfiguration="PayPalAPIAASoapBinding" contract="PayPalSvc.PayPalAPIAAInterface" name="PayPalAPIAA" />
  <endpoint address="https://api.sandbox.paypal.com/2.0/" binding="basicHttpBinding" bindingConfiguration="PayPalAPISoapBinding2" contract="PayPalLive.PayPalAPIInterface" name="PayPalAPI1" />
  <endpoint address="https://api-aa-3t.sandbox.paypal.com/2.0/" …
Run Code Online (Sandbox Code Playgroud)

web-config service-reference visual-studio

3
推荐指数
1
解决办法
3607
查看次数

如何从 DNN 中的 .ascx Web 用户控件更新 ScriptManager?

我创建了一个需要在我的 .ascx 页面中使用的 Web 服务。我不能只是添加这个:

<asp:ScriptManager ID="OWUScripts" runat="server">
    <Services>
        <asp:ServiceReference Path="~/OWUDashboard.asmx" />
    </Services>
</asp:ScriptManager>
Run Code Online (Sandbox Code Playgroud)

因为那时我在页面上有多个 ScriptManager。所以我做了一些研究,发现我需要将它添加到 Page_Load 事件中...

Dim myScriptManager As ScriptManager = ScriptManager.GetCurrent(Me.Page)

Dim objServiceReference As ServiceReference = New ServiceReference()
objServiceReference.Path = "~/MyService.asmx"
myScriptManager .Services.Add(objServiceReference)
Run Code Online (Sandbox Code Playgroud)

但是我无法访问 Page_Load 事件,因为已经有一个预设(它是一个皮肤等等)所以我把代码扔在了 <script runat="server"></script>

然而,它给了我一个错误,说“Declaration Expected”......我拿出了几行,它似乎在说它找不到 Me.Page (或者它是空的)

关于我做错了什么的任何见解?

我可以<script runat="server">像我一样访问 Me.Page还是应该以不同的方式访问?

asp.net dotnetnuke web-services scriptmanager service-reference

2
推荐指数
1
解决办法
3871
查看次数

Reporting Services Web代理路径不是wsdl

我试着效仿这个例子:

http://msdn.microsoft.com/en-us/library/aa179614%28SQL.80%29.aspx#

它说要将以下路径添加为Web引用:

http://myserver/reportserver/reportservice.asmx

我已经尝试过(使用myserver的服务器名称)并且它总是返回错误.

当我尝试将其作为Web引用时,它说"HTML文档不包含Web服务发现信息".

我该如何添加此服务?我显然遗漏了文档中没有的内容.有没有人能够为SSRS添加Web引用(或服务引用)?如果是这样,它是如何完成的?

注意:我使用的是Visual Studio 2010 Ultimate和SQL Server 2008 R2.

visual-studio-2010 service-reference visual-studio reporting-services ssrs-2008

2
推荐指数
1
解决办法
4058
查看次数

更新服务引用后,Project不会生成

更新服务引用后,我收到以下错误构建我的项目:

不包含'DefaultResolveType'的定义

在自动生成的Reference.cs上抛出错误,但DefaultResolveType方法应该在生成的类中,因为它是从'this'关键字调用的.自上次成功构建以来,数据服务没有更改,客户端代码也没有更改.

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]

protected global::System.Type ResolveTypeFromName(string typeName)
{
    global::System.Type resolvedType = this.DefaultResolveType(typeName, "Microsoft.Crm.Sdk.Data.Services", "ITF.DataAccessLayer.CRM.CrmAccessService");
    if ((resolvedType != null))
    {
        return resolvedType;
    }

    return null;
 }
Run Code Online (Sandbox Code Playgroud)

.net c# wcf service-reference

2
推荐指数
1
解决办法
2755
查看次数

何时使用WCF ChannelFactory而不是服务引用

我正在阅读WCF教程并发现这些内容指出我可以使用mex端点来允许隐式地向客户端添加服务引用.我想这允许VS在使用生成的WSDL文件时创建代理类?

但是,我试图让自己熟悉的代码库不使用隐式服务引用.相反,客户可以访问DuplexChannelFactory.通过显式ChannelFactories与隐式服务引用进行服务通信有什么好处?

这里的SO问题(如何重写WCF客户端以使用ChannelFactory而不是服务引用)提到公司选择ChannelFactories而不是服务引用,但没有提到原因.

wcf channelfactory service-reference

2
推荐指数
1
解决办法
612
查看次数

在 ASP NET Core 中添加服务引用

我在 ASP NET Core 中的服务引用有问题。在控制台应用程序中,我有“添加服务引用”选项,但在网络应用程序中我没有看到此功能。

c# service-reference asp.net-core

2
推荐指数
1
解决办法
5000
查看次数

Stylecop抑制Reference.cs文件的错误

我刚才问过类似的问题,关于从自动生成的代码Service ReferencesXml summary errors.发布了一个答案,建议我可以将Service Reference其添加到自己的项目中,然后它可以完全避免Xml摘要警告和Stylecop错误.

但我意识到我能够Xml通过设置Service Reference来解决问题,Internal现在我已经陷入了StyleCop错误.

我使用的是FxCop10.0版.

在我的项目的属性中,在"代码分析"选项卡中,我检查了选项

从生成的代码中抑制结果(仅限托管)

另外,通过查看Reference.cs文件中生成的代码,我看到代码使用以下属性进行修饰:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
Run Code Online (Sandbox Code Playgroud)

.. Stylecop然后应该跳过,对吗?虽然这不起作用,但我仍然会StyleCop为生成的代码收到错误.

编辑:在生成的代码中也可以找到以下标题:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18033
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

那为什么不被忽视呢? …

fxcop stylecop suppress-warnings service-reference

1
推荐指数
1
解决办法
1140
查看次数

在同一项目中向WCF服务添加服务引用

将服务引用添加到项目中是否可以接受编程实践,其中被引用的服务是在同一VS项目中定义的?(服务和服务参考在同一个项目中)

例:

MyWebAppProj
-Services
--MyService
-Service References
--MyServiceServiceReference.MyServiceClient
-Default.aspx.cs使用MyServiceServiceReference.MyServiceClient

这背后的理性是可以在项目中添加Silverlight应用程序.如果是,我们将不得不通过服务层公开所有业务逻辑方法,所以为什么不首先这样做,并在任何地方使用它们在网页和Silverlight页面之间保持标准化.

wcf web-reference projects-and-solutions service-reference

0
推荐指数
1
解决办法
2562
查看次数

为什么Silverlight添加服务参考 使用eventing而不是IAsyncResult?

Ye Olde添加Web引用会对使用事件的服务生成XXXAsync调用,以通知呼叫者呼叫已完成.

在WPF或控制台应用程序中添加服务引用,当被告知生成异步操作时,使用IAsyncResult设计模式(BeginXXX和EndXXX操作).我的理解是,这通常被认为是可用性和灵活性的一个进步 - 您可以使用回调,您可以通过调用EndXXX在任何时间点开始阻止,您可以对等待句柄进行分组并阻止一组操作,你可以投票等

为什么Silverlight中的ASR不使用IAsyncResult?我的猜测是因为设计人员想要非常清楚地表明事实上需要完全异步性,并且如果他们使用了IAsyncResult设计模式,那么尝试只需调用Begin然后紧跟End就太容易了.对于一个可能被大约100%的新开发者或者没有很好地掌握异步的人所击中的绊脚石.

silverlight wcf asynchronous service-reference

0
推荐指数
1
解决办法
536
查看次数