将MVC应用程序发布到Azure失败,而错误_NOT_SUPPORTED错误



我想通过Visual Studio 2017将MVC应用程序发布到Azure App Servis。但是发布的出版物失败了,错误_not_supported错误。IMG:https://i.stack.imgur.com/e9zip.png

在TMP文件(由错误消息标记(中出现以下消息:

System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

我尝试更改Azure Web应用程序常规设置(帧工作版本,平台…(,并将所有应用程序设置从Web.config添加到我的Azure应用程序服务中,但无济于事。我的MVC应用程序具有以下web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
  </configSections>
  <appSettings>
    <add key="IsInTestMode" value="false" />
    <add key="UseDB" value="..." />
    <add key="StoredProcedureNamePrefix" value="..." />
    <add key="NumberOfRetriesAtTransactionDeadlock" value="20" />
  </appSettings>
  <connectionStrings>
    <add name="ProductionConnectionString" connectionString="Data Source=...." />
  </connectionStrings>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <authentication mode="Windows" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    <caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="LongTime" duration="7200" varyByParam="none" />
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
    <authorization>
      <deny users="?" />
    </authorization>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
    <sessionState timeout="3" />
  </system.web>
  <system.webServer>
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
    <httpCompression>
      <dynamicTypes>
        <add mimeType="application/json" enabled="true" />
        <add mimeType="application/json; charset=utf-8" enabled="true" />
      </dynamicTypes>
    </httpCompression>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e3" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <nlog autoReload="true" throwExceptions="true" internalLogFile="${basedir}/Logs/internal_log.txt" internalLogLevel="Trace">
    <!--......-->
  </nlog>
</configuration>

我在启用"匿名用户,输入类型:local"命令中,在iis manager.net授权规则中启用了"匿名用户,entry type:local"命令后,我将应用程序安装到了Azure虚拟机IIS上,并且它正在运行。通过DEAFULT"拒绝"设置应用程序的"拒绝"消息失败。

某人是否遇到了相同的情况,或者有任何线索可能是什么问题,或者我该如何解决?

我可以解决我的问题。在项目中,wpp.targets文件设置为" deployiisapppath"。从wpp.targets删除后,请提交此内容:

<DeployIisAppPath> Default Web Site/... </DeployIisAppPath>

我可以发布我的WebApplication。

感谢您的帮助。

相关内容

  • 没有找到相关文章