2010-08-13 7 views
2

Azure에 넣으려고하는 응용 프로그램은 ASP.NET 3.5에서 작성되었으며, 구름으로 이동할 때 4.0으로 변환되었습니다.Azure에서 jsonSerialization을 설정할 수 없습니다.

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

이 줄은 영원히 바쁜 상태에 붙어 웹 역할 원인 : 내 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> 

어떤 제안이 좋은 것 :

다음은 전체의 Web.config입니다! 다시 system.web.extensions 섹션을 제거하면 모든 것이 잘 동작합니다 (재정의 된 maxJsonLength가 필요한 코드 제외).

또한 System.Web.Extensions의 로컬 배포를 시도했습니다. 거기도 가지 마라.

감사합니다.

+0

개발 패브릭에서 실행됩니까? – knightpfhor

답변

1

나는 동일한 문제가있었습니다. Yi-Lin Luo의 해결 방법은 this thread입니다. 이 내용은 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> 
관련 문제