Antal Nagy
Antal Nagy

Reputation: 21

Publish MVC App to Azure failed with ERROR_NOT_SUPPORTED error

I would like to publish an MVC application to the Azure App Servis via Visual Studio 2017. But the Publish failed with ERROR_NOT_SUPPORTED error. img: https://i.sstatic.net/E9zIP.png

In the tmp file (which was marked by the error message) the following message came up:

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()

I tried change the Azure Web App General Settings (Frame Work version, Platform…) and adding all Application settings from Web.config to My Azure App service, but didn't help. My MVC application have the following 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>

I succesfully installed my application to the Azure Virtual Machine IIS and it's running without any complication, after i enable the "Anonymous Users , Entry Type: Local" command in the IIS Manager.Net Authorization Rules. With deafult "Deny" setting the application failed with an "Acces denied" message.

Did someone met with the same situation or has any clue what could be the problem or how can i solve this?

Upvotes: 1

Views: 344

Answers (1)

Antal Nagy
Antal Nagy

Reputation: 21

I could solve my problem. In the project wpp.targets file was set the "DeployIisAppPath". After i deleted from the wpp.targets file this:

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

I could Publish my WebApplication.

Thanks for the Help.

Upvotes: 1

Related Questions