iis 404
Closed this issue · 7 comments
Hi all,
I'm trying to use Owin with iis and I keep getting 404 because the MVC handlers are being called instead for the Owin ones.
I have added Owin to the web.config handlers and it works for IIS express but not for IIS
Part of my web.config file:
<system.webServer>
</system.webServer>
Startup class
public partial class Startup
{
public void Configuration(IAppBuilder builder)
{
builder.Map("/resources", sw => sw.UseSimpleWeb());
}
}
The handler I'm trying to test.
[UriTemplate("/resources/home")]
public class GetIndex : IGet, IOutput
{
readonly DataService _dataService;
public GetIndex(DataService dataService)
{
_dataService = dataService;
}
public Status Get()
{
this.Output = "OwinHost runnnig Simple.Web!";
return 200;
}
public RawHtml Output { get; set; }
}
Thanks in advance for your help.
I can second that, with the current NuGet package, after having removed the reference to Fix from web.config, I'm getting a 404 to anything but the root and a 403 otherwise. (This happens in an existing app and with a simple test app as well.)
i'm having the same problem.
iis express works fine. no go in IIS full.
I can't get the latest package to work in either, even if a completely new project. I pulled down Fix and something seems to be going awry in there. Going to dig into it more later tonight.
I figured what's causing the problem.
IIS appends an application name to the pathbase that IIS express and OWIN (I think) don't.
For example localhost:123 becomes localhost/Sandbox/ in IIS and let's say, a request to get the index page will cause simple.web to try and match '/Sandbox/' instead of '/' in the routing table.
This can be solved if the application name is included in every UriTemplate but the question is whether simple.web should be able to handle this or not.
Simple.Web should not include the BasePath in the routing. I will fix this over the weekend.
—
Sent from Mailbox for iPhone
On Thu, Oct 31, 2013 at 2:21 PM, paljo notifications@github.com wrote:
I figured what's causing the problem.
IIS appends an application name to the pathbase that IIS express and OWIN (I think) don't.
For example localhost:123 becomes localhost/Sandbox/ in IIS and let's say, a request to get the index page will cause simple.web to try and match '/Sandbox/' instead of '/' in the routing table.This can be solved if the application name is included in every UriTemplate but the question is whether simple.web should be able to handle this or not.
Reply to this email directly or view it on GitHub:
#89 (comment)
This is fixed, I just need to do a release.
i've been trying to run the latest under IIS (compiled locally).
what do i need (minimum example) to get it to run under IIS.
is there an easy way to look at the routing table to determine what Simple.Web has detected. RoutingTable.Get as it trys to get a matcher from the _statics but it seems to break down somewhere.
i'm literally trying to get the most simple example working.
[UriTemplate("/home")]
public class Index : IGet, IOutput<RawHtml>
{
public Index()
{
}
public Status Get()
{
this.Output = "OwinHost runnnig Simple.Web!";
return 200;
}
public RawHtml Output { get; set; }
}
given a asp.net website running under the default web site.
e.g. localhost/myapp
i try the URL localhost/myapp/home
but at the moment i cant get it to work.