1

問題:

基になる接続が閉じられました:接続が予期せず閉じられました。これは、開発サーバーに組み込まれているVisualStudio2010でホストされているWCFサービスで発生します。

情報:

これは「ビッグデータ」の問題であると私が信じているときはいつも起こりません。私はできる限りグーグルで検索しましたが、実装したソリューションのどれも修正されていません(そして私はそれらのほとんどを試してみました)私はほとんどおそらく愚かな何かが欠けているだけです。

質問:

なぜこれが起こっているのですか、どうすれば修正できますか?

クライアントapp.Config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="Program.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
              <binding name="BasicHttpBinding_IService1" maxReceivedMessageSize="20000000"
                 maxBufferSize="20000000"
                 maxBufferPoolSize="20000000">
                <readerQuotas maxDepth="32"
                 maxArrayLength="200000000"
                 maxStringContentLength="200000000"/>
              </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:62753/Service1.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IService1" contract="ProgramService.IService1"
                name="BasicHttpBinding_IService1" />
        </client>
      <behaviors>
        <endpointBehaviors>
          <behavior name="EndpointBehavior">
            <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          </behavior>
        </endpointBehaviors>
      </behaviors>
    </system.serviceModel>
    <applicationSettings>
        <Program.Properties.Settings>
            <setting name="Program_PROGRAM_Screen" serializeAs="String">
                <value>http://localhost/IntegrationTest/SOAP/PROGRAM.asmx</value>
            </setting>
        </Program.Properties.Settings>
    </applicationSettings>
</configuration>

サービスweb.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <httpRuntime executionTimeout="1200" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  <connectionStrings>
    <add name="ProgramEntities" connectionString="metadata=res://*/Program.csdl|res://*/Program.ssdl|res://*/Program.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=ACUMATICA1-HPI7;initial catalog=Program;persist security info=True;user id=sa;password=$0l0m0n;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

WCFアクティビティログエラーメッセージ:

パラメータ http://tempuri.org/:ScenarioSummaryResultをシリアル化しようとしたときにエラーが発生しました。InnerExceptionメッセージは、 『データコントラクト名を持つ『「タイプ』System.Data.Entity.DynamicProxies.ScenarioSummary_A170028D0330F7804BAB85D00BA1EB45FA1754C8A6F6E98C0F003F15078E23A9たScenarioSummary_A170028D0330F7804BAB85D00BA1EB45FA1754C8A6F6E98C0F003F15078E23A9:http://schemas.datacontract.org/2004/07/System.Data.Entity.DynamicProxies』が期待されていません。DataContractResolverを使用するか、既知のタイプのリストに静的に不明なタイプを追加することを検討してください。たとえば、KnownTypeAttribute属性を使用するか、DataContractSerializerに渡される既知のタイプのリストに追加します。詳細については、InnerExceptionを参照してください。

サービス情報:

EntityFrameworkのもののリストを返そうとしています

//IService1.cs
[OperationContract]
List<ProgramService.ScenarioSummary> ScenarioSummary(string Module);

//Service1.svc
public List<ProgramService.ScenarioSummary> ScenarioSummary(string module)
        {
            return (from p in Entity.ScenarioSummaries where p.ModuleId.Equals(Entity.Modules.FirstOrDefault(q => q.ModuleName.Equals(module)).Id) select p).ToList();
        }

追加情報:

この問題に関する私の明らかな無能さとそれを修正する方法についての助け/説明をいただければ幸いです。

4

1 に答える 1

1

ある人は、私のエラーは、EFコードのCTP5のProxyCreationEnabledを最初にオフにすることの欠点は何ですか?

それが実際に私の解決策であることがわかりました。その後、投稿を削除しました。私よりグーグルスキルの高い不思議な見知らぬ人に感謝します。

于 2013-01-23T19:57:32.093 に答える