How to publish a Asp.net 5 MVC6 website on IIS containing two web apps

961 Views Asked by At

I have got a project with two web apps. One of them is only for reference in the base app. The project runs okay in visual studio. I am trying to publish it in local file system and then copy it across to the windows server 2008. Below is the web.config generated by visual studio.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="bootstrapper-version" value="1.0.0-beta4" />
    <add key="runtime-path" value="..\approot\packages" />
    <add key="dnx-version" value="1.0.0-beta4" />
    <add key="dnx-clr" value="clr" />
    <add key="dnx-app-base" value="..\approot\src\MySite" />
  </appSettings>
</configuration>

When I run this website in Server using dnx . web, it runs okay. But when I try to run it under IIS by pointing IIS to wwwroot then all of the packages go missing. The website is unable to find packages.

Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1':
  Base32 1.0.0.13
  BouncyCastle 1.7.0
  CsQuery 1.3.4
  EcmaScript.Net 1.0.1.0
  EntityFramework 7.0.0-beta4
  EntityFramework.Commands 7.0.0-beta4
  EntityFramework.Core 7.0.0-beta4
  EntityFramework.Relational 7.0.0-beta4
  EntityFramework.Relational.Design 7.0.0-beta4
  EntityFramework.SqlServer 7.0.0-beta4
  EntityFramework.SqlServer.Design 7.0.0-beta4
  .........
  .........
1

There are 1 best solutions below

2
On BEST ANSWER

How did you deploy?

Here are the steps that you can follow to get that running:

  1. Make sure that you the app pool is a .NET 4 app pool
  2. Run, in your web app's project folder dnu publish --runtime <name of runtime> (the name is the name of the runtime folder under %userprofile%\.dnx\runtimes
  3. Step 2 generates a folder that contains the application, its dependencies and the runtime under the bin\debug folder.
  4. Copy that folder to the IIS website folder
  5. Run