Question

I'm trying to deploy an ASP.NET MVC5 application on Windows Azure Websites, but keep getting this error on my git push:

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.

I've enabled nuget restore, and I have another MVC4 App that deploys fine.

Was it helpful?

Solution

To help identify the issue, I suggest starting with a clean clone of your repo on your local machine. Then run NuGet restore, and check that all the relative references in your .csproj can be resolved. It looks like it's trying to fall back to the GAC, which usually happens when relative paths are messed up.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top