Articles of 单声道

Mono 3.2.x上带有快速CGI的Razor引擎 – 目标特定.net?

我的网站在单声道2.10上工作,我几乎完成升级到单声道3.2.x的全新服务器。 它使用XSP4,ServiceStack Razor视图呈现正确。 (它在2.10中修复了很多文物) 当我设置网站使用nginx +快速CGI(4)但是我得到一个HttpCompileException,由以下原因引起的: The predefined type `System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition from `mscorlib.dll' 请记住,这与xsp4工作正常,所以我认为它需要一些设置绑定到一个.Net实例,也许它在.net 4.0和.net 4.5之间混淆? 关于如何强迫它只使用其中一个的任何build议? 注:我使用最新的(3.2.7)从git安装,因为3.2.5版本会崩溃。 我使用干净的Amazon EC2 Ubuntu 12.04 64位。 它之前没有单声道,当我尝试3.2.5时,它是另一个现在被删除的实例。 这与以下大致相同的错误: 单引号上的RazorEngine – 抛出TemplateCompilationException 但是我没有安装其他版本。 构build过程添加了其他已被删除的内容。 mscorlib的所有实例都在这里: /usr/lib/mono/2.0/mscorlib.dll /usr/lib/mono/4.5/mscorlib.dll /usr/lib/mono/4.0/mscorlib.dll

nginx中多个FastCGI ASP.NET单声道后端的版本化URL

我计划在nginx后面有多个运行FastCGI的ASP.NET应用程序。 这些多个应用程序的二进制文件不同,我希望nginx根据它们的URI将请求转发到相应的ASP.NET应用程序。 单声道应用程序本身始终在根path"/"上进行侦听。 我假设我将不得不修改位置指令和fastcgi_params,但我不知道哪些fastcgi_params我必须改变,以使其工作。 示例用例: 应该将http://www.server.com/api/1/status转发到在TCP端口9000上运行的FastCGI应用程序,请求URI应该被重写为/status 。 http://www.server.com/api/2/status应该被转发到运行在TCP端口9001上的FastCGI应用程序,请求URI也应该被重写为/status以匹配ASP.NET侦听器configuration。 转发到FastCGI时,URI的/ api / {version}部分应该被删除。 我尝试了这个nginxconfiguration,ASP.NET通过FastCGI调用,但是无法处理请求: location ~ /api/1/(.*) { root /usr/aspnet/; fastcgi_pass 127.0.0.1:9000; include /etc/nginx/nginx-fastcgi-params.conf; fastcgi_param REQUEST_URI /$1; } 我不知道是否我的方法与位置指令是完全正确的,有什么想法? /编辑:这是我想出的解决scheme。 显然不需要其他的fastcgi_params: location ~ ^/api/1/(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param SCRIPT_NAME /$1; }

HTTP处理程序不能正确注册在Mono MVC 3下

我不知道该怎么做。 我试图通过FastCGI在Mono下运行ASP.NET MVC 3网站,而Cassette的HTTP处理程序将无法正确注册。 该网站是http://www.tychaia.com/ 。 奇怪的是: 它在我的本地机器上正常工作。 当网站在生产机器上的xsp4下运行时,它工作正常。 当网站在生产机器上的fastcgi-mono-server4下运行时,它不能正常工作。 我已经尝试过的事情: 检查Nginxconfiguration,确保它传递了所有正确的FastCGI参数(它是)。 单声道3.0.7和3.0.10。 一个朋友在3.0.7下工作,但对我没有骰子。 这是特定的Web.config项: <add path="cassette.axd" verb="*" type="Cassette.Aspnet.CassetteHttpHandler, Cassette.Aspnet" /> ( https://github.com/hach-que/Tychaia/blob/master/Tychaia.Website/Web.config#L47 ) 据我所知,我有两个问题导致这个问题: MVC的IgnoreRoute并不匹配cassette.axd URL,即使它在https://github.com/hach-que/Tychaia/blob/master/Tychaia.Website/Global.asax.cs#L20 (和它明确指定在简单的旧XSP4下工作)。 当我为string“cassette.axd”添加一个明确的IgnoreRoute(通过执行routes.IgnoreRoute("cassette.axd"); ),它开始传递给处理程序,除了: 服务器的HTTP处理程序path匹配似乎只能在FastCGI下完成匹配。 即使当我closures所有在站点的MVC注册,处理程序只匹配cassette.axd ,即使如此,处理程序似乎没有任何path信息。 当我添加更多的条目,如<add path="cassette.axd/*" verb="*" type="Cassette.Aspnet.CassetteHttpHandler, Cassette.Aspnet" />这些也开始被处理程序处理,通常应该在这个url上做出回应; 你只需要获取默认值,就好像没有附加的URL参数(也许它们被HTTP处理程序path匹配所使用)。 FastCGI目前的设置方式是: 主要的Nginx实例,它只是一个反向代理到更多的Nginx实例(我运行多个网站,我喜欢让他们孤立)。 它指向: http://tychaia.com/的Nginx实例,它通过UNIX套接字调用FastCGI。 同样,这个问题在XSP4下不会发生, 它只发生在FastCGI下。 虽然我可以将代理转换为XSP4实例,但由于性能方面的原因,我仍然犹豫不决。 还有什么我可以在这里失踪? 编辑:这是一些应该工作的url。 正如你所看到的,他们正在碰到StaticFileHandler而不是Cassette HTTP处理程序: http://tychaia.com/cassette.axd/stylesheet/nDvbK5eAxf6miyaRa_J0vl7YdxA=/Content http://tychaia.com/cassette.axd/script/oz4BBh-gK6gJkhB5S64l3mXseFQ=/Scripts 您可以看到,明确指定了IgnoreRoute后, cassette.axdpath确实会映射,但只有该path: […]

单声道+ MVC 4 + .NET 4.0 + nginx 404(也用XSP)

在testing框上: root@ubuntu:/var/www# mono –version Mono JIT compiler version 3.0.6 (Debian 3.0.6+dfsg-1~exp1~pre1) Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: Included Boehm (with typed GC and Parallel Mark) XSP(从github编译) root@ubuntu:/var/www# xsp4 –version Mono.WebServer2.dll 0.4.0.0 (c) (c) 2002-2011 […]

坏的网关与Debian上的nginx,单声道和fastcgi

我正在努力与Linux的.NET替代单声道。 这是我的元数据: OS: Debian 7.6 alias Wheezy (as virtual machine; host: Windows 7 Pro SP1) nginx v1.6.1 (installed from nginx repository) mono v3.6.0 (compiled from source) mono-fastcgi-server4 (installed from Debian repositories) nginx正常工作; 我没有单声道testing,所以不应该是这个问题。 当我在nginxserver config中启用fastcgi部分时,会出现这个问题:我得到一个502坏的网关。 为了您的信息,这些都是我编辑的所有configuration文件。 我认为这些是重要的: /etc/nginx/conf.d/default.conf server { listen 80; server_name myserver.net; root /var/www/myserver.net; index index.html; location / { fastcgi_index index.html; fastcgi_pass 127.0.0.1:9000; […]

错误:“无法处理连接。 原因:对象被使用后,使用nginx,fastcgi-mono-server4和ServiceStack

我已经设置了nginx在Ubuntu 10.04上使用ServiceStack。 这是我用来启动fastcgi-mono-server4的命令行: /usr/lib/mono/4.0/fastcgi-mono-server4.exe –appconfigdir /etc/init.d/mono-fastcgi /socket=unix:/var/tmp/SOCK-WW /logfile=/var/log/mono/fastcgi.log & nginx设置正确,通过套接字与fastcgi进行通信: … location / { root /var/www/server01; index index.html index.htm default.aspx Default.aspx; fastcgi_index Default.aspx; fastcgi_pass unix:/var/tmp/SOCK-WW; include /etc/nginx/fastcgi_params; } … 该网站得到正确传递,但在我的fastcgi.log我看到每一个请求这些行: [2013-08-01 10:43:37Z] Notice Beginning to receive records on connection. [2013-08-01 10:43:37Z] Error Failed to process connection. Reason: The object was used after being disposed. 涉及的软件版本: […]

fastcgi单声道套接字(nginx:拒绝访问)

我有一个Ubuntu的(13.04)/ Nginx的/单声道设置。 它的工作原理是当我设置fastcgi-mono-server4上的套接字到TCP,但是我想使用套接字。 我用启动时运行的这个脚本启动它: #!/bin/sh ### BEGIN INIT INFO # Provides: monoserve.sh # Required-Start: $local_fs $syslog $remote_fs # Required-Stop: $local_fs $syslog $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start fastcgi mono server with hosts ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/mono NAME=monoserver DESC=monoserver MONOSERVER=$(which fastcgi-mono-server4) MONOSERVER_PID=$(ps auxf | grep […]

在nginx上debuggingfastcgi-mono-server4,有可能吗?

关于如何使用xsp服务器进行本地开发debugging的信息很多,只是来自官方mono网站的一个例子 : 我想在我的堆栈跟踪行号 默认情况下,xsp和xsp2以“释放”模式运行,这意味着在运行时不会生成debugging信息。 如果你想在你的堆栈跟踪中使用行号,你必须将–debug选项传递给Mono,这是通过调用xsp或xsp2和MONO_OPTIONS环境variables来完成的,如下所示: $ MONO_OPTIONS=–debug xsp Listening on port: 8080 (non-secure) Listening on address: 0.0.0.0 Root directory: /tmp/us Hit Return to stop the server. 如果您使用Apache运行mod_mono,则必须在configuration文件中使用MonoDebug指令,如下所示: MonoDebug true 在nginx上可能吗?

什么是.NET平台文件扩展名?

我已经在Linux服务器上安装了单声道平台,并且能够在nginx HTTP服务器之后运行它。 该系统运行良好,完美地服务于.NET特定的dynamic文件。 但是,我只想传递所需的文件(扩展名)为mono,并让nginx处理所有其他文件,包括静态文件和在.NET平台上不应该正常工作的文件。 我已经configuration了我的nginx,如下所示,但是 – 因为我对.NET平台没有足够的了解 – 我不确定哪些扩展必须传递给mono,哪些必须被禁止。 这里是我的nginxconfiguration文件的相关部分: # Do not pass .NET forbidden extensions to anywhere. # Theese are the extensions that should not be served to the clients location ~ \.(config|dbml|dll|master|other|forbidden|exts)$ { deny all; } 这里是configuration的一部分,将所需的(只有)文件传递给单声道: # Theese are the extensions which *must* be handled by mono location ~ \.(aspx|cs|other|exts|that|must|be|handled|by|mono)$ { […]

Ubuntu服务器中的DocumentFormat.OpenXml

我有一个基本的C#应用​​程序,使用Open XML SDK。 我想让它在我的Nginx和Ubuntu和DigitalOcean服务器上运行。 该应用程序编译和运行良好的Windows, 我的Mac与单声道 。 然后,我在Ubuntu服务器上安装了单声道,并将.exe文件scp到服务器,并运行mono ConsoleApplication2.exe ,它返回以下错误: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. File name: 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at ConsoleApplication2.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, […]