Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC4 Azure deployment can't find WebPages or WebMatrix references

I'm attempting to deploy a site to Azure automatically via GitHub and upon committing to the master branch, Azure picks it up and attempts to deploy but I get a 'deployment failed' message with errors like the following:

App_Start\AuthConfig.cs(1,21): error CS0234: The type or namespace name 'WebPages' does not exist in the namespace 'Microsoft.Web' (are you missing an assembly reference?) [C:\DWASFiles\Sites\xxxxx\VirtualDirectory0\site\repository\xxxxx.UI.Web\xxxxx.UI.Web.csproj]

And

Controllers\AccountController.cs(18,7): error CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\xxxxx\VirtualDirectory0\site\repository\xxxxx.UI.Web\xxxxx.UI.Web.csproj]

MVC 4 (and the WebMatrix/WebPages dependencies) are installed in my UI.Web project via NuGet, not loaded from the GAC. Copy Local is set to true on the assembly references. Any idea why I might be getting these deployment issues?

like image 483
Scott Avatar asked Apr 02 '13 00:04

Scott


1 Answers

Have you tried deploying with NuGet package restore? Then Azure should download all dependencies during deployment and GitHub isn't littered with binaries.

Just right click on a solution and hit "Enable NuGet Package Restore". Commit with the .nuget folder in your solution directory with packages.config in your project dir, that were created.

-- As for you current problem - you could drop your GitHub's link, that would be helpful. Maybe you used default .ignore for Visual Studio and that does prevent commiting binaries.

like image 191
Lars Avatar answered Nov 09 '22 22:11

Lars