Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
Vb.net LightSwitch应用程序在实例化WCF代理时阻塞_Vb.net_Wcf_Wcf Ria Services_Visual Studio Lightswitch - Fatal编程技术网

Vb.net LightSwitch应用程序在实例化WCF代理时阻塞

Vb.net LightSwitch应用程序在实例化WCF代理时阻塞,vb.net,wcf,wcf-ria-services,visual-studio-lightswitch,Vb.net,Wcf,Wcf Ria Services,Visual Studio Lightswitch,我正在尝试为基于web的应用程序创建LightSwitch管理面板。这就是为什么我要设置一个WCF RIA服务来与web应用程序的WCF服务接口。在测试用户加载时,我发现LightSwitch说它无法加载资源。即时窗口告诉我System.ServiceModel.dll中发生了System.InvalidOperationException,但VS实际上并没有将我指向产生错误的loc。在执行了一些逐行代码之后,我发现它在WCF代理的实例化时被阻塞了 WCF RIA服务类上的代码示例: Publi

我正在尝试为基于web的应用程序创建LightSwitch管理面板。这就是为什么我要设置一个WCF RIA服务来与web应用程序的WCF服务接口。在测试用户加载时,我发现LightSwitch说它无法加载资源。即时窗口告诉我System.ServiceModel.dll中发生了System.InvalidOperationException,但VS实际上并没有将我指向产生错误的loc。在执行了一些逐行代码之后,我发现它在WCF代理的实例化时被阻塞了

WCF RIA服务类上的代码示例:

Public Class RIAInterface
    Inherits DomainService
    Private WCFProxy As New Service.UserClient() '<-- Choke Point

    Public Sub New()
        WCFProxy.Open()
    End Sub

    <Query(IsDefault:=True)>
    Public Function GetUsers() As IQueryable(Of User)
        Dim TempList As New List(Of User)
        For Each User As Service.User In WCFProxy.GetUsers()
            TempList.Add(New User With {.ID = User.ID, .FullName = User.FullName,   .EmailAddress = User.Email, .Username = User.UserName, .Class = User.Class.Name, .AccountType = User.Privilege.Name})
        Next
        Return TempList.AsQueryable
    End Function
End Class
公共类接口
继承域服务

Private WCFProxy As New Service.UserClient()'建议:尝试创建一个简单的控制台应用程序,并在Sub Main中从中实例化代理。我尝试了你的建议,效果很好,我从服务中获得了有效对象,没有任何异常。在那之后,我想使用RIA服务尝试同样的方法,在那里我发现了一些非常有趣的东西。在我引用了包含RIA服务的DLL之后,我设置了所有代码。在我按F5运行应用程序之前,一切似乎都很好。VS使对DLL的引用无效,并说没有声明RIA服务。我重新创建了对DLL的引用,在我点击F5之前,一切都很好。这是App.config的ServiceModel配置的内容:
<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="EduNetBackEnd_IUser" closeTimeout="00:01:00" openTimeout="00:01:00"
                receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                allowCookies="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:15:00"
                    enabled="true" />
                <security mode="None">
                    <transport clientCredentialType="Windows" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="Windows" negotiateServiceCredential="true" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="[Service_Address]"
            binding="wsHttpBinding" bindingConfiguration="EduNetBackEnd_IUser"
            contract="EduNet.IUser" name="EduNetBackEnd_IUser" />
    </client>
</system.serviceModel>