Ошибка веб-развертывания Visual Studio при запуске предварительного просмотра

#visual-studio-2015 #asp.net-web-api2 #msdeploy #visual-web-developer

#visual-studio-2015 #asp.net-web-api2 #msdeploy #visual-web-разработчик

Вопрос:

Я работаю над проектом Visual Studio 2015 Web API.

Я создал веб-пустой проект с помощью опции API. Я выбираю опцию веб-развертывания в процессе публикации приложения web api на сервере. Я создал пользовательский профиль, предоставил необходимые сведения и успешно прошел «Проверку подключения», но получил ошибку на странице предварительного просмотра мастера публикации веб-сайта.

ошибка

 Web deployment task failed. (The specified credentials cannot be used with the authentication scheme 'Basic'.)

The specified credentials cannot be used with the authentication scheme 'Basic'.
Default credentials cannot be supplied for the Basic authentication scheme.
Parameter name: authType
  

Мой файл Web.Config

 <?xml version="1.0" encoding="utf-8"?> 
<configuration>
<appSettings></appSettings>
<system.web>
 <compilation debug="true" targetFramework="4.5.2"/>
 <httpRuntime targetFramework="4.5.2"/>
 <httpModules>
  <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>
<system.webServer>
<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
  <remove name="OPTIONSVerbHandler"/>
  <remove name="TRACEVerbHandler"/>
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler"
    preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
  <remove name="ApplicationInsightsWebTracking"/>
  <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
    preCondition="managedHandler"/>
  </modules>
  </system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  </dependentAssembly>
</assemblyBinding>
  

Ответ №1:

Попробуйте установить для AuthType значение NTLM в вашем профиле публикации (.pubxml):

 <PropertyGroup>
  <AuthType>NTLM</AuthType>