If you’re trying to deploy your ASP.NET 5 beta 7 application, you may be running into this error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DNX.PackageManager' or one of its dependencies. The system cannot find the file specified.

The reason for that is the version of Visual Studio 2015 in the hosted build controller doesn’t have the latest set of web tools installed. The only way around this, besides hosting your own build controller, is to drop back to dnu build and dnu publish.

The Change

We need to add an extra (hopefully temporary) PowerShell script that is going to do the build and publish for us. I created a file called LocalPublish.ps1 at the root of my solution and had contents similar to this:

Why am I including the dnvm stuff again? Apparently the environment variables set by the Prebuild.ps1 for dnx don’t carry through the build steps properly. Since this is a temporary solution, I wasn’t too worried about it.

I then changed my build steps from this:

To this (I’m deploying multiple projects, so ignore the duplicate steps):

In the new LocalPublish.ps1 PowerShell script, you just need to specify LocalPublish.ps1 for the script filename, then in arguments something along these lines:--vsoProjectName "YourVsoProjectName" --projectName "YourCompany.YourApp.Web" --buildConfiguration $(BuildConfiguration) --buildSourcesDirectory $(Build.SourcesDirectory)

Once that’s set, you should be able to build again (assuming you have no hard requirement on Visual Studio specifically)!

Gotcha: Relative Pathing

One additional note, I did run into an issue with grunt and relative pathing. I had a SASS task setup like this: