Missing method errors when running ASP.NET app with xsp on linux

前端 未结 2 686
無奈伤痛
無奈伤痛 2020-12-16 20:45

I have ASP.NET with MVC and Razor markup website and I want to run it on my Linux VPS.

I have mono 3.2.8 and xsp4 3.0.0.0 version, both from Ubuntu repository (insta

2条回答
  •  萌比男神i
    2020-12-16 21:26

    This is not really a full answer but perhaps what I did may help someone get a little further.

    After filling in some unrelated voids on the dev branch of Mono (which at the time was v3.99) like AppendTrailingBackslash(), GetBufferlessInputStream() and a few other functions, I was able to get an MVC5 app to come up and function OK on Ubuntu using XSP4.

    I then tried to use OWIN and the mono-built version of SignalR.

    I did what Appleman1234 suggested above, implement RegisterModule() in HttpApplication.cs to do what Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule() does. This does seem to work and injects the module string into the system.web/httpModules section without error.

    This combined with manually specifying the OwinHttpHandler in my system.web:

    
        
        
        
    
        
          
        
    
    
    

    and calling the default MapSignalR() in my Startup Configuration():

    var appBuilder = app.MapSignalR();
    

    and after hacking up some of the SignalR code (I was getting some ReadOnlyException on a NameValueCollection as it tried to remove the Accept-Encoding from the request headers... I figured I'd get to that later), I think I got it to initialize all the way to the point where I could at least browse to /signalr and get some meaningful errors back (missing connectionId, unknown protocol, etc). I didn't get to actually testing the SignalR functionality, but I am about to do so by using a separate client program.

    I am hosting this using xsp4/mono 4.5.

    However, in doing so I think I clobbered the rest of the handlers/pipeline because I cannot really browse to anything else in the website (stylesheets, scripts, etc), as I get a 404

    Also note that:

    (1) HttpRuntime.UsingIntegratedPipeline returns false in the context of XSP4.

    (2) I had to comment out the exception in HttpApplication.cs/AsyncInvoker::Invoke(), which originally threw this exception:

    throw new Exception("This is just a dummy");
    

    Given this, is there simply not yet enough Async and other support in Mono to get OWIN/SignalR to work? I am thinking that since UsingIntegratedPipeline returns false that it's a no-go for XSP4?

提交回复
热议问题