SourceBrowser: HTTP 404 on generated site
Hi,
I’ve been using Microsoft.SourceBrowser from NuGet, but it doesn’t support the new project format with MSBuild 15.0, or new syntax with Roslyn 2.0.
I’ve managed to build the latest code from source.
I used the following command-line to generate the index and website:
C:\Git\SourceBrowser\src\HtmlGenerator\bin\Debug\net46\HtmlGenerator.exe /force /out:__SourceBrowser__ /in:ProjectList.txt
The generated site appears to mostly work, but there’s no main page. URLs such as /i.txt work, but / just returns a HTTP 404.
At first I thought this might be an IIS issue, so I used dotnet to run Kestrel and got the same result.
C:\CW\__SourceBrowser__>dotnet .\Microsoft.SourceBrowser.SourceIndexServer.dll --help
Hosting environment: Production
Content root path: C:\CW\__SourceBrowser__
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 170.0031ms 404
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 0.7488ms 404
Am I missing a step, or is the generated site actually incomplete?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (27 by maintainers)
Commits related to this issue
- Fix Missing wwwroot Fixes #80 — committed to alexperovich/SourceBrowser by alexperovich 7 years ago
- Fix Missing wwwroot (#82) Fixes #80 — committed to KirillOsenkov/SourceBrowser by alexperovich 7 years ago
Just re-ran with the latest
HtmlGenerator.wwwrootis present and the site works.Thanks!
It looks like this was a breaking change from 1.1 sdk to the 2.0 sdk. In the 1.1 sdk Content items were included in the publish output by default. In 2.0 Content items are only included in the publish output if CopyToPublishDirectory metadata is set on them. I will send a PR to fix this.
I just succeeded with the following workflow in powershell:
After that
http://localhost:5000/had a functioning index.