开始预览时Visual Studio Web部署错误

时间:2016-10-07 08:31:38

标签: visual-studio-2015 asp.net-web-api2 msdeploy visual-web-developer

我正在开发Visual Studio 2015 Web API项目。

我创建了带有API Option的Web Empty Project。我选择Web Deploy选项来在服务器上发布web api app。我创建了自定义配置文件,提供了需求详细信息并成功传递了“验证连接”,但在发布Web向导的预览页面中出现错误。

错误

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 个答案:

答案 0 :(得分:0)

尝试在发布配置文件(.pubxml)中将AuthType设置为NTLM:

<PropertyGroup>
  <AuthType>NTLM</AuthType>