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

谁说我不能喝 提交于 2019-12-01 01:21:54

问题


I copied these files to C:\MonoWebServer.

xsp2.exe
xsp2.exe.mdb
Mono.WebServer2.dll
Mono.Security.dll

I registered Mono.WebServer2.dll & Mono.Security.dll in the GAC. When I go to run xsp2.exe I get.

What am I doing wrong!

Windows 7 - 64bit


回答1:


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.



来源:https://stackoverflow.com/questions/9747169/getting-could-not-load-file-or-assembly-xsp2-with-mono-2-10-8

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