gpt4 book ai didi

c# - 无法使用 git 部署到 Azure

转载 作者:行者123 更新时间:2023-11-30 22:01:50 25 4
gpt4 key购买 nike

我正在 mac 上使用 Xamarin studio 开发 ASP.NET MVC Razor 应用程序。一切都在本地运行,但是当我推送到 azure 时,它无法部署。这是输出:

remote: Running deployment command...
remote: Handling .NET Web Application deployment.
remote: ..........
remote: Installing 'Microsoft.AspNet.WebPages 3.2.0'.
remote: Successfully installed 'Microsoft.AspNet.WebPages 3.2.0'.
remote: Installing 'Microsoft.Data.OData 5.6.2'.
remote: Installing 'Microsoft.AspNet.Mvc 5.2.0'.
remote: Successfully installed 'Microsoft.AspNet.Mvc 5.2.0'.
remote: Installing 'Microsoft.Web.Infrastructure 1.0.0.0'.
remote: Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'.
remote: Installing 'Microsoft.Data.Edm 5.6.2'.
remote: Installing 'System.Spatial 5.6.2'.
remote: Successfully installed 'Microsoft.Data.OData 5.6.2'.
remote: Successfully installed 'System.Spatial 5.6.2'.
remote: Successfully installed 'Microsoft.Data.Edm 5.6.2'.
remote: Installing 'Microsoft.Data.Services.Client 5.6.2'.
remote: Successfully installed 'Microsoft.Data.Services.Client 5.6.2'.
remote: ......................
remote: Installing 'Newtonsoft.Json 5.0.8'.
remote: Successfully installed 'Newtonsoft.Json 5.0.8'.
remote: Installing 'WindowsAzure.Storage 4.3.0'.
remote: Successfully installed 'WindowsAzure.Storage 4.3.0'.
remote: Installing 'Microsoft.AspNet.Razor 3.2.0'.
remote: Installing 'Microsoft.WindowsAzure.ConfigurationManager 1.8.0.0'.
remote: Successfully installed 'Microsoft.AspNet.Razor 3.2.0'.
remote: Successfully installed 'Microsoft.WindowsAzure.ConfigurationManager 1.8.0.0'.
remote: ..
remote: WeddingSite -> D:\home\site\repository\WeddingSite\bin\WeddingSite.dll
remote: D:\home\site\repository\WeddingSite\WeddingSite.csproj : error MSB4057: The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the project.
remote: Failed exitCode=1, command="D:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "D:\home\site\repository\WeddingSite\WeddingSite.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="C:\DWASFiles\Sites\#1raouf-wedding\Temp\5314389e-4e5d-40f3-a7ce-0493eae3f70c";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="D:\home\site\repository\.\\"
remote: An error has occurred during web site deployment.
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c18ca8b3bba092a8aaa0afa5a4b381b3a0aeb4a7ecb6a4a5a5a8afa6efb2a2acefa0bbb4b3a4b6a4a3b2a8b5a4b2efafa4b5" rel="noreferrer noopener nofollow">[email protected]</a>:443/raouf-wedding.git
* [new branch] master -> master

我无法弄清楚这个问题。

最佳答案

我遇到了同样的问题,以下是我用来解决它的步骤:1.编辑.csproj文件并在标签中添加以下内容,它应该是文件中的第一个标签。

<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets"     Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" Condition="true" />

您需要确保 (MSBuildExtensionsPath32) 指向正确的路径,在我的例子中,我需要使用 v12.0,但如果您有 2013 年之前的 VS 版本,则可能是 v11。

还在 web.config 中添加了此部分:

<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>

我还将 azure 中的管道模式更改为经典。

关于c# - 无法使用 git 部署到 Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27399781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com