Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.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
无法将在本地计算机上运行良好的简单django webapp部署到Azure_Django_Azure_Azure Web App Service_Web Deployment - Fatal编程技术网

无法将在本地计算机上运行良好的简单django webapp部署到Azure

无法将在本地计算机上运行良好的简单django webapp部署到Azure,django,azure,azure-web-app-service,web-deployment,Django,Azure,Azure Web App Service,Web Deployment,我有一个简单的Django网络应用程序,它在我的机器上就像一个魔咒。但是,当我尝试使用VS 2015将其发布到Azure Webapp时(右键单击项目,然后单击发布按钮),结果是出现了运行时错误: 然后,我尝试通过将“”添加到web.config文件来修复。结果是另一个错误: “/”应用程序中出现服务器错误。 找不到类的类型 Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.Windows

我有一个简单的Django网络应用程序,它在我的机器上就像一个魔咒。但是,当我尝试使用VS 2015将其发布到Azure Webapp时(右键单击项目,然后单击发布按钮),结果是出现了运行时错误:

然后,我尝试通过将“”添加到web.config文件来修复。结果是另一个错误:

“/”应用程序中出现服务器错误。
找不到类的类型
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,
Microsoft.WindowsAzure.Diagnostics,版本=1.0.0.0,区域性=中性,…

我尝试了和教程,但它们没有帮助。我不知道这些文件是否过期

请拯救我的一天

更新: 我不确定该发布哪个日志文件,因为我是Azure新手。以下是文件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>
D:\home\site\wwwroot\
RD0003FF2899E0
9328
w3wp.exe
IIS APPPOOL\DjangoWebProject220170522042402
目标异常
调用的目标已引发异常。
位于System.RuntimeMethodHandle.InvokeMethod(对象目标、对象[]参数、签名符号、布尔构造函数)
位于System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(对象obj,对象[]参数,对象[]参数)
在System.Reflection.RuntimeMethodInfo.Invoke(对象obj、BindingFlags invokeAttr、绑定器绑定器、对象[]参数、CultureInfo区域性)
位于System.RuntimeType.InvokeMember(字符串名称、BindingFlags BindingFlags、绑定器绑定器、对象目标、对象[]提供的参数、参数修改器[]修饰符、CultureInfo区域性、字符串[]namedParams)
位于System.Web.Compilation.BuildManager.RestorePortableCompilationOutputSnapshot()处
位于System.Web.Compilation.BuildManager.ExecuteRepapStart()处
在System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager、IApplicationHost appHost appHost、IConfigMapPathFactory configMapPathFactory、HostingEnvironmentParameters hostingParameters、PolicyLevel PolicyLevel、Exception appDomainCreationException)
找不到Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener类的类型,Microsoft.WindowsAzure.Diagnostics,版本=1.0.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35。
位于System.Diagnostics.TraceUtils.GetRuntimeObject(字符串类名称、类型baseType、字符串初始化数据)
位于System.Diagnostics.TypedElement.BaseGetRuntimeObject()处
位于System.Diagnostics.ListenerElement.GetRuntimeObject()处
位于System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()处
在System.Diagnostics.TraceInternal.get_Listeners()中
位于System.Diagnostics.TraceInternal.WriteLine(字符串消息)
位于Microsoft.Web.Compilation.Snapshot.SnapshotHelper.RestoreSnapshot(字符串选项)
http://djangowebproject220170522042402.azurewebsites.net/handler.fcgi/
/handler.fcgi/
62.177.198.5
假的
IIS APPPOOL\DjangoWebProject220170522042402
21
IIS APPPOOL\DjangoWebProject220170522042402
假的
位于System.RuntimeMethodHandle.InvokeMethod(对象目标、对象[]参数、签名符号、布尔构造函数)
位于System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(对象obj,对象[]参数,对象[]参数)
在System.Reflection.RuntimeMethodInfo.Invoke(对象obj、BindingFlags invokeAttr、绑定器绑定器、对象[]参数、CultureInfo区域性)
位于System.RuntimeType.InvokeMember(字符串名称、BindingFlags BindingFlags、绑定器绑定器、对象目标、对象[]提供的参数、参数修改器[]修饰符、CultureInfo区域性、字符串[]namedParams)
位于System.Web.Compilation.BuildManager.RestorePortableCompilationOutputSnapshot()处
位于System.Web.Compilation.BuildManager.ExecuteRepapStart()处
在System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager、IApplicationHost appHost appHost、IConfigMapPathFactory configMapPathFactory、HostingEnvironmentParameters hostingParameters、PolicyLevel PolicyLevel、Exception appDomainCreationException)
和详细错误文件:

<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> 
最可能的原因:
IIS收到请求;但是,在处理请求期间发生内部错误。
此错误的根本原因取决于处理请求的模块和
发生此错误时工作进程中发生了什么。
  • IIS无法访问网站或的web.config文件 应用 如果NTFS权限设置不正确,可能会发生这种情况。
  • IIS 无法处理网站或应用程序的配置。
  • 经过身份验证的用户没有使用此DLL的权限。
  • 请求被映射到托管处理程序,但.NET可扩展性 未安装功能。
  • 您可以尝试的事情:
    • 确保web.config文件的NTFS权限正确,并允许访问web服务器的计算机帐户。
    • 检查事件日志以查看是否记录了任何其他信息。
    • 验证DLL的权限。
    • 如果请求映射到托管处理程序。
    • 创建跟踪规则以跟踪此HTTP状态代码的失败请求。有关为失败请求创建跟踪规则的详细信息,请单击
    我尝试了线程的解决方案,它成功了:

    通过转到Azure门户->应用程序禁用动态缓存 设置,然后将“网站动态缓存”的值设置为“0” (零)


    这两份文件没有过时。
    的错误无法找到Microsoft.WindowsAzure.Diagnostics.Diagnostics MonitorTraceListener类的类型对于查找真正原因而言不明确。请