2017-05-22 1 views
0

Ich habe eine einfache Django-Webanwendung, die wie ein Zauber auf meinem Computer funktioniert. Allerdings, wenn ich es zu Azure Webapp mit VS 2015 (durch Rechtsklick auf das Projekt und klicken Sie auf Schaltfläche Veröffentlichen) zu veröffentlichen versucht, wird es einen Laufzeitfehler aus:Eine einfache Django-Webanwendung kann nicht auf Azure bereitgestellt werden, die auf dem lokalen Computer gut funktioniert

enter image description here

Dann habe ich versucht, durch Zusatz zu beheben "< customErrors mode =" Aus "/>" an die Datei web.config. Es stellt sich heraus einen anderen Fehler: Server Error in '/' Application. Couldn't find type for class Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, ..

Ich versuchte, die this und this Tutorial aber sie helfen nicht. Ich weiß nicht, ob diese Dokumente nicht veraltet sind.

Bitte speichern Sie meinen Tag.

Update: Ich bin nicht sicher, welche Protokolldatei zu posten, da ich neu bei Azure bin. Hier ist, was in der Datei eventlog.xml:

<Data>D:\home\site\wwwroot\</Data> 
<Data>RD0003FF2899E0</Data> 
<Data/> 
<Data>9328</Data> 
<Data>w3wp.exe</Data> 
<Data>IIS APPPOOL\DjangoWebProject220170522042402</Data> 
<Data>TargetInvocationException</Data> 
<Data>Exception has been thrown by the target of an invocation. 
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) 
    at System.Web.Compilation.BuildManager.RestorePortableCompilationOutputSnapshot() 
    at System.Web.Compilation.BuildManager.ExecutePreAppStart() 
    at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) 

Couldn't find type for class Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. 
    at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) 
    at System.Diagnostics.TypedElement.BaseGetRuntimeObject() 
    at System.Diagnostics.ListenerElement.GetRuntimeObject() 
    at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() 
    at System.Diagnostics.TraceInternal.get_Listeners() 
    at System.Diagnostics.TraceInternal.WriteLine(String message) 
    at Microsoft.Web.Compilation.Snapshots.SnapshotHelper.RestoreSnapshot(String options) 

</Data> 
      <Data>http://djangowebproject220170522042402.azurewebsites.net/handler.fcgi/</Data> 
      <Data>/handler.fcgi/</Data> 
      <Data>62.177.198.5</Data> 
      <Data/> 
      <Data>False</Data> 
      <Data/> 
      <Data>IIS APPPOOL\DjangoWebProject220170522042402</Data> 
      <Data>21</Data> 
      <Data>IIS APPPOOL\DjangoWebProject220170522042402</Data> 
      <Data>False</Data> 
      <Data> at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) 
    at System.Web.Compilation.BuildManager.RestorePortableCompilationOutputSnapshot() 
    at System.Web.Compilation.BuildManager.ExecutePreAppStart() 
    at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) 
</Data> 

Und DetailErrors Dateien:

<fieldset><h4>Most likely causes:</h4> 
<ul> <li>IIS received the request; however, an internal error occurred during the processing of the request. 
The root cause of this error depends on which module handles the request and 
what was happening in the worker process when this error occurred.</li>  
<li>IIS was not able to access the web.config file for the Web site or 
application. 
This can occur if the NTFS permissions are set incorrectly.</li> <li>IIS 
was not able to process configuration for the Web site or application.</li>  
<li>The authenticated user does not have permission to use this DLL.</li> 
<li>The request is mapped to a managed handler but the .NET Extensibility 
Feature is not installed.</li> </ul> 
</fieldset> 
</div> 
<div class="content-container"> 
<fieldset><h4>Things you can try:</h4> 
<ul> <li>Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.</li>  <li>Check the event logs to see if any additional information was logged.</li> <li>Verify the permissions for the DLL.</li> <li>Install the .NET Extensibility feature if the request is mapped to a managed handler.</li> <li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul> 
</fieldset> 
</div> 
+0

Die beiden Dokumente sind nicht aus Datum. Der Fehler von 'Konnte Typ für Klasse Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener nicht finden, ist nicht explizit & klar, um den wahren Grund herauszufinden. Bitte posten Sie weitere Fehlerdetails und einige Codes, die zur Behebung des Problems beitragen. –

+0

Inzwischen gibt es einige ähnliche SO-Threads, denen Sie die vorhandenen Antworten folgen können, um zu versuchen, Ihre zu lösen, siehe https://stackoverflow.com/questions/43630361/flask-application-fails-after-updated-azure-service- Plan, https://stackoverflow.com/questions/36236008/azure-python-web-app-internal-server-error und https://stackoverflow.com/questions/38200782/azure-flask-http-error-500- 0-Interner-Server-Fehler. Jedes Update, bitte zögern Sie nicht mich zu informieren. –

+0

Danke, ich aktualisiere mehr Detailprotokolle in der Frage. –

Antwort

0

Ich versuchte Lösung von this Fäden und es funktionierte:

Disable the Dynamic Cache by going to the Azure Portal -> Application Settings and then setting the value of 'WEBSITE_DYNAMIC_CACHE' to '0' (zero).

Verwandte Themen