Starting application in monodevelop vs xsp4

时光总嘲笑我的痴心妄想 提交于 2019-12-11 04:14:43

问题


I build an ASP.Net WebApi project with mono in Linux.

When I start (Debug/Release) the Application within Monodevelop. The application runs without errors. Example : I start a (Debug/Release) session. Then I navigate to 127.0.0.1:9000/api/person/ . Then I receive the expected xml output.

However, when I execute the xsp4 server from within the "bin" directory. The application starts fine, but when I go to 127.0.0.1:9000/api/person/ . I'm ending with the following exception:

Description: HTTP 404.The resource you are looking for (or one of its dependencies) 
could have been removed, had its name changed, or is temporarily unavailable. Please 
review the following URL and make sure that it is spelled correctly.

Details: Requested URL: /api/person/
Exception stack trace:
at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
at System.Web.DefaultHttpHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback callback, System.Object state) [0x00000] in <filename unknown>:0 
at System.Web.HttpApplication+ <Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0 
at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0  

Im using :

  • Monodevelop 4.1.7
  • Mono: 3.2.7
  • Ubuntu 13.10
  • xsp4: same version as monodevelop is using.
  • bin: location of the compiled binaries of the project build with monodevelop.

Question:

  • What steps do i miss, which monodevelop automates?
  • How to get an advanced output(Browser or console) to identify the missing file?
  • Why is the file missing in the standalone xsp4 and not in monodevelop?

In addition: I didn't noticed this problem until i tried to deploy the app to appharbor.


回答1:


xsp4 is supposed to be run from the web application directory, not from bin directory.

The reason is in the ASP.NET architecture: a web application consist of a main directory ( say webapp) and several standard directories.

Let's just focus on bin, which only contains compiled assemblies referenced by your web application.

Simply said, if you run xsp4 under the scope of the bin directory, it'll never be able to reference Index.aspx. On the other hand, running Index.aspx from webapp allows the server to load any required assembly from the bin directory



来源:https://stackoverflow.com/questions/21288026/starting-application-in-monodevelop-vs-xsp4

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