Alex
Alex

Reputation: 910

ASP.NET Core on Azure: Can not find assembly file dotnet-razor-tooling.exe

I cannot find the problem within my ASP.NET Core application. After deployment on azure it says: Internal server error. Exception:

InvalidOperationException: Can not find assembly file dotnet-razor-tooling.exe at 'D:\home\site\wwwroot\refs,D:\home\site\wwwroot\'

project.json:

{
  "dependencies": {
    "Microsoft.AspNet.WebApi.Client": "5.2.3",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Mvc.WebApiCompatShim": "1.0.0",
    "Microsoft.AspNetCore.Razor": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.DependencyInjection": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Net.Http.Server": "1.0.0-beta6",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
    "NLog": "4.3.7",
    "NLog.Extensions.Logging": "1.0.0-rtm-alpha4",
    "NLog.Interface": "3.2.1",
    "PostSharp": "4.3.15"
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    }
  },

  "frameworks": {
    "net452": {
      "dependencies": {
        "JECodingTest.Business": {
          "target": "project"
        }
      }
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

Tried to update Razor, but id did not help me. Any suggestions?

Upvotes: 3

Views: 278

Answers (1)

Nate Barbettini
Nate Barbettini

Reputation: 53610

This error can occur if you're using an older version of the Razor tooling packages. In your project.json, you have:

"Microsoft.AspNetCore.Razor.Tools": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},

The latest version at the time of writing is 1.0.0-preview2-final. You can update the packages by editing the project.json file directly, or by using the NuGet Package Manager GUI (make sure to select Include Prerelease).

Make sure that both the package reference in the dependencies section and the reference in the tools section get updated.

Upvotes: 4

Related Questions