从git部署azure网站时出错

uplii1fm  于 2021-06-20  发布在  Kudu
关注(0)|答案(1)|浏览(492)

我正在尝试在windows azure网站上部署asp.net mvc5应用程序,但在我的git推送上不断出现以下错误:

All packages listed in packages.config are already installed.

Trex.Web.Common -> D:\home\site\repository\src\Trex.Web.Common\bin\Release\Trex.Web.Common.dll

D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]

D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]

App_Start\RouteConfig.cs(28,13): error CS1928: 'System.Web.Routing.RouteCollection' does not contain a definition for 'MapHttpRoute' and the best extension method overload 'System.Web.Http.HttpRouteCollectionExtensions.MapHttpRoute(System.Web.Http.HttpRouteCollection, string, string, object)' has some invalid arguments [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]

App_Start\RouteConfig.cs(28,13): error CS1929: Instance argument: cannot convert from 'System.Web.Routing.RouteCollection' to 'System.Web.Http.HttpRouteCollection' [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]
App_Start\RouteConfig.cs(34,13): error CS1928: 'System.Web.Routing.RouteCollection' does not contain a definition for 'MapHttpRoute' and the best extension method overload 'System.Web.Http.HttpRouteCollectionExtensions.MapHttpRoute(System.Web.Http.HttpRouteCollection, string, string, object)' has some invalid arguments [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]

App_Start\RouteConfig.cs(34,13): error CS1929: Instance argument: cannot convert from 'System.Web.Routing.RouteCollection' to 'System.Web.Http.HttpRouteCollection' [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]
App_Start\TrexAppSetup.cs(112,13): error CS0103: The name 'GlobalConfiguration' does not exist in the current context [D:\home\site\repository\src\Trex.Web.Admin\Trex.Web.Admin.csproj]
Failed exitCode=1, command="D:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "D:\home\site\repository\src\Trex.Web.

Admin\Trex.Web.Admin.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="C:\DWASFiles\Sites\credli-web-admin-staging\Temp\b5bff328-3b38-49b7-afab-8064f800112f";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="D:\home\site\repository\src\\"
An error has occurred during web site deployment.

我已经启用了nuget restore,而且我还有一个mvc4应用程序可以很好地部署。

nr9pn0ug

nr9pn0ug1#

为了帮助识别问题,我建议从本地机器上的repo的干净克隆开始。然后运行nuget restore,检查是否可以解析.csproj中的所有相对引用。它看起来像是在试图退回到gac,这通常发生在相对路径混乱的时候。

相关问题