Getting “could not load file or assembly 'xsp2'” with Mono 2.10.8

痞子三分冷 提交于 2019-12-01 04:57:23

Ok I'v got it working now. Here are the steps.

  1. Create an empty Asp.net MVC site.
  2. Copy xsp4.exe, Mono.Security.dll & Mono.WebServer2.dll to the root of the site.
    The file structure should look like this.
    WebSite
    --bin
    --Content
    --Models
    --Views
    xsp4.exe
    Mono.Security.dll
    Mono.WebServer2.dll

  3. Copy those same 3 files into the bin folder.

  4. Now run xsp4.exe from the root folder. By default it should run on port 8080. So open a browser to http://localhost:8080 and it should work.

Notes
I'm not really sure why but xsp creates a new instance of MonoWebServer based on the assembly name of the Server class. So when it trys to resolve it, it defaults to looking in the bin folder. Thats why you have to copy xsp and any dependency files to the bin folder.

You can get the files xsp2.exe, xsp4.exe, Mono.Security.dll & Mono.WebServer2.dll from installing the newest version of Mono.

Framework versions
This works for web sites built on .NET 4.0. If your trying to deploy .NET 2.0 sites then you will need to register Mono.Security.dll & Mono.WebServer2.dll in the GAC and use xsp2.exe instead of xsp4.exe.

Deployment
Xsp web server does not need the Mono framework to run on Windows machines with .NET Framework installed.

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