2

Azure に入れようとしているアプリは ASP.NET 3.5 でビルドされていましたが、クラウドに移行するときに 4.0 に変換しました。このブロックを web.config に追加しようとするまで、すべてがうまく機能します。

<system.web.extensions>
  <scripting>
   <webServices>
    <jsonSerialization maxJsonLength="10000000"></jsonSerialization>
   </webServices>
  </scripting>
 </system.web.extensions>

この行により、Web ロールは永遠にビジー状態のままになります。

これが web.config 全体です。

<?xml version="1.0"?>
<!--
 For more information on how to configure your ASP.NET application, please visit
 http://go.microsoft.com/fwlink/?LinkId=169433
 -->
<configuration>
 <appSettings>
  ...
 </appSettings>
 <system.diagnostics>
  <trace>
   <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
     <filter type="" />
    </add>
   </listeners>
  </trace>
 </system.diagnostics>
 <connectionStrings>
  ...
 </connectionStrings>
 <system.web>
  <customErrors mode="Off"/>
  <compilation targetFramework="4.0">
   <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
   </assemblies>
  </compilation>
  <httpHandlers>
   <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false" />
  </httpHandlers>
 </system.web>
 <system.webServer>
  <modules runAllManagedModulesForAllRequests="true" />
  <validation validateIntegratedModeConfiguration="false" />
  <handlers>
   <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
  </handlers>
 </system.webServer>
 <system.web.extensions>
  <scripting>
   <webServices>
    <jsonSerialization maxJsonLength="10000000"></jsonSerialization>
   </webServices>
  </scripting>
 </system.web.extensions>
</configuration>

どんな提案も素晴らしいでしょう!ここでも、system.web.extensions セクションを削除すると、すべて正常に動作します (オーバーライドされた maxJsonLength を必要とするコードを除く)。

System.Web.Extensions のローカル展開も試しました。そこにも行きません。

ありがとう!

4

2 に答える 2

1

同じ問題がありました。このスレッドの Yi-Lin Luo による回避策は、私のためにそれを行いました。configSectionsこれは;に追加する必要があります。そうしjsonSerializationないと、Azure 環境で認識されません。

   <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
        </sectionGroup>
      </sectionGroup>
   </sectionGroup>
于 2011-06-17T01:54:20.360 に答える
0

その行を省略しても本当に機能していますか?このケースのようです: http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/6c739db9-4f6a-4203-bbec-eba70733ec16

于 2010-08-23T12:35:20.990 に答える