Need help in modifying OWIN (Katana) for running VS2013's MVC WebApplication in Raspberry Pi

跟風遠走 提交于 2019-12-13 03:51:42

问题


I want to run Visual Studio 2013's default MVC WebApplication in Raspberry Pi 2. I managed to install mono 4.0.1 and Lighttpd as the web server, and I was able to get this default MVC WebApplication (with no authentication) run on the Raspberry machine. However, when I tried the same MVC WebApplication but with "Individual Authentication", it gives the following error:

System.MissingMethodException: Method 'HttpApplication.RegisterModule' not found.

After googling, I found it here that this method 'RegisterModule()' is not implemented in mono's System.Web.HttpApplication. And the solution is to rebuild OWIN. I have never done that before. I used 'Git Bash' to clone the Katana as follow:

git clone https://git01.codeplex.com/katanaproject

then modified the PreApplicationStart.cs accordingly, and then run 'build' in command prompt, and it successfully created the Microsoft.Owin.Host.SystemWeb.dll under the project directory. I then tried to replace the original dll with this new one in Visual Studio 2013, and hit F5 to try to run it, and get the following errors:

The type 'Microsoft.Owin.IOwinContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null'.  

and

'Microsoft.Owin.IOwinContext' does not contain a definition for 'GetUserManager' and the best extension method overload 'Microsoft.AspNet.Identity.Owin.OwinContextExtensions.GetUserManager<TManager>(Microsoft.Owin.IOwinContext)' has some invalid arguments

Is this the proper way to rebuild the OWIN and update this Microslft.Owin.Host.SystemWeb.dll? Any suggestion to get it work?

Thanks.


回答1:


Got it work by using Visual Studio 2013 to build the project Microsoft.Owin.Host.SystemWeb directly, then use the result Microsoft.Owin.Host.SystemWeb.dll to replace the one used in the original MVC WebApplication project.



来源:https://stackoverflow.com/questions/30186770/need-help-in-modifying-owin-katana-for-running-vs2013s-mvc-webapplication-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!