ASP.NET 5 Beta 7 – Microsoft.Dnx.Host.Clr missing with GIT deploy

If I create a new ASP.NET v5 application in VS2015 and publish it to azure, it works fine. But when I setup continuous deployment with my GIT repository I get this error viewing the page after the deployment:

Could not load file or assembly ‘Microsoft.Dnx.Host.Clr’ or one of its dependencies. The system cannot find the file specified.

  • Angular 2 SpaTemplate how to remove server-side rendering and what does that mean performance wise
  • Increment a number in Bitbucket pipelines
  • Dotnet Restore Failed on Build Server
  • Rebuild Docker container on file changes
  • How do I run gulp.js in my asp.net core project when deploying to Azure using git?
  • Dependency projects in a TFS Git project VNEXT build
  • What’s the trick to getting this setup in the web app with a GIT deploy?

  • Is there a way to disable vim's swap file warning?
  • Git pull from Bitbucket server
  • Create a git bare repo from two existing repository
  • Git branches with completely different content
  • GIT: Restoring untracked files after reverting to previous commit
  • Git merge with force overwrite
  • One Solution collect form web for “ASP.NET 5 Beta 7 – Microsoft.Dnx.Host.Clr missing with GIT deploy”

    I believe the issue is related to the version of DNX running on your Azure web app.I had a similar issue: Taking a standard ASP.NET 5 Web API app generated by yeoman, adding this project with no modifications to git and then using this repo as the source for Continuous deployment in Azure results in the same error you are experiencing.

    Azure uses kudu to manage git deploys, and it appears the version of DNX used by default is currently beta6 (detail here). Following the first commit, navigating to the site\approot\runtimes folder in the kudu debug console (more info here) shows the runtime as dnx-CLR-win-x86.1.0.0-beta6.

    Adding a global.json file into the project root with the following:

    {
      "sdk": {
        "version": "1.0.0-beta7"
      }
    } 
    

    …committing to git and then redeploying appears to resolve this particular error, updating the runtime to dnx-CLR-win-x86.1.0.0-beta7.

    Git Baby is a git and github fan, let's start git clone.