Mvc icon indicating copy to clipboard operation
Mvc copied to clipboard

Problems hosting rc1-final-update1 on IIS

Open ghostdlr opened this issue 10 years ago • 17 comments

Works just fine when I run it on my computer from Visual studio ( in IIS express) . But when I try to host the website on my server (WS 2012 , IIS 8 ), the page takes forever to load .

I found this error in log:

C:\iis\beta\wwwroot>IF "C:\iis\beta\approot\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnx.exe" == "" (SET "DNX_PATH=dnx.exe" ) 
Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'. Available commands: web, ef.
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath)
   at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)
   at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName)
   at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func2 factory)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args)
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

Here's my project.json:

{
  "webroot": "wwwroot",
  "userSecretsId": "aspnet5-gplayweb-11fc9aea-7741-4cff-ba1f-fc74dfb7600b",
  "version": "1.0.0-*",

  "dependencies": {
    "EntityFramework.Commands": "7.0.0-rc1-final",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
    "Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
    "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
    "Microsoft.AspNet.Session": "1.0.0-rc1-final",
    "MySql.Data": "6.9.8"
  },
  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel",
    "ef": "EntityFramework.Commands"
  },

  "frameworks": {
    "dnx451": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

ghostdlr avatar Dec 29 '15 21:12 ghostdlr

Are you actually trying to use the Kestrel web server or are you trying to run in IIS?

Eilon avatar Dec 29 '15 23:12 Eilon

I'm trying to run on IIS

Self hosting doesn't work either . The console window closes instantly ... I don't have time to read the contents.

ghostdlr avatar Dec 29 '15 23:12 ghostdlr

Have you read the docs at https://docs.asp.net/en/latest/publishing/iis.html ? They also cover various common errors.

Eilon avatar Dec 29 '15 23:12 Eilon

Yes, I did read it a couple of times .

I don't get any errors . Just "Waiting for ..." status in chrome and the page never finishes loading .

ghostdlr avatar Dec 30 '15 00:12 ghostdlr

Hmm definitely weird. @kichalla @Tratcher any idea about this or how to debug it?

@ghostdlr does the Windows Event Log have anything? Or IIS FREB logs?

Eilon avatar Dec 30 '15 00:12 Eilon

@ghostdlr How are you creating the content for the IIS hosted website? like did you do a local file publish and then pointing your website to the published wwwroot folder?

kichalla avatar Dec 30 '15 00:12 kichalla

It used to work just fine with beta8 .

I found this in Windows Logs:

The description for Event ID 1000 from source HttpPlatformHandler cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Process '35632' failed to start. Port = 31225, Error Code = '-2147023829'.

ghostdlr avatar Dec 30 '15 00:12 ghostdlr

Yes, I published the website Release-x86 , dnx-clr-win-x86.1.0.0-rc1-update1 , then I upload it to my server and point IIS to wwwroot .

ghostdlr avatar Dec 30 '15 00:12 ghostdlr

I can start teamviewer, if anyone wants to take a look .

ghostdlr avatar Dec 30 '15 09:12 ghostdlr

Self hosting doesn't work either . The console window closes instantly ... I don't have time to read the contents.

Open a console window, navigate to your published output and run web.cmd. This should at least let you see the error.

Tratcher avatar Jan 04 '16 22:01 Tratcher

It shows the same error: Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'. Available commands: web, ef. System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002) at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) at System.Reflection.Assembly.LoadFile(String path) at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath) at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext) at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName) at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName) at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName) at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func2 factory) at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName) at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

ghostdlr avatar Jan 06 '16 14:01 ghostdlr

We have exactly the same problem with: "The description for Event ID 1000 from source HttpPlatformHandler cannot be found." Worked fine with Beta8. Any ideas?

rbjarnason avatar Jan 07 '16 16:01 rbjarnason

@ghostdlr Sounds like a deployment issue. Is this a virtual directory? Are you using publish from vs. I.e. right click publish.

mikes-gh avatar Jan 07 '16 21:01 mikes-gh

@rbjarnason It appears to be an issue with the event log manifest installer. It's harmless, just noisy. We've got the HttpPlatformHandler team looking into it.

Tratcher avatar Jan 07 '16 23:01 Tratcher

Thanks guys but the problem is fixed now. This was not published through VS and it turned out that some files had not been overwritten since the last version.

rbjarnason avatar Jan 08 '16 12:01 rbjarnason

@mikes-gh I publish with visual studio ... right click , Publish I just point IIS to a folder on the server hdd where the website is uploaded .

ghostdlr avatar Jan 09 '16 01:01 ghostdlr

I fixed the problem by deleting global.json from approot\src\website\

ghostdlr avatar Jan 10 '16 16:01 ghostdlr