我有modaspdotnet在我的Apache 2.2服务器上工作,因此它运行ASP.NET和MysqL相当不错。
但是,我想要做的是提供其他扩展的内容,而不仅仅是默认的.aspx,例如myfile.customextension。
在Apache中,我相信这是通过.htaccess完成的,但是在ASP.NET中是通过web.config完成的。
如何在Windows 8.1中安装WPF Performance Suite?
如何从桌面应用程序打开Windows资源pipe理器和search?
使用installutil从具有多个服务的可执行文件安装单个服务
如何在系统托盘中显示图标?
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> </system.web> <system.webServer> <staticContent> <mimeMap fileExtension=".testing1" mimeType="application/x-asp-net " /> </staticContent> </system.webServer> </configuration>
它工作,但ASP.NET代码不能正确呈现 – 我想能够运行任何自定义扩展的ASP.NET代码。
IIS和NET 3.5安装。
我不想运行一个完整的IIS服务器,但需要一个ASP.NET项目,因此Apache的modaspdotnet插件。
这是我的httpd.conf的最后一行,表示安装modaspdotnet:
LoadModule aspdotnet_module modules/mod_aspdotnet.so # Use the asp.net handler for all common ASP.NET file types AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo <IfModule mod_aspdotnet.cpp> # For all virtual ASP.NET webs,we need the aspnet_client files # to serve the client-side helper scripts. AliasMatch /aspnet_client/system_web/(d+)_(d+)_(d+)_(d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4" <Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles"> Options FollowSymlinks Order allow,deny Allow from all </Directory> </IfModule> #asp.net AddType application/x-asp-net .asp AddType text/html .asp AddHandler application/x-httpd-PHP .asp
为什么这不适合我,我该怎么办才能解决这个问题? 我看了看networking,但找不到太多…有什么想法?
计算Windows进程的cpu使用率?
如何在registry中存储securestring?
NAnt和双平台构build – 在Windows和Mono / Linux上构build的最佳方式
.net应用程序在Linux上运行吗?
简单地添加MIME类型是不够的 – 页面不是简单的,而是简单地流向浏览器。 我不太了解apache。 但通常当你想服务正常的aspx页面,但有不同的扩展,你必须:
像这样在自定义扩展中添加您的默认aspx httphandler:
<httpHandlers> ... <add verb="*" path="*.mycustomextension"> type="System.Web.UI.PageHandlerFactory"/>
注册构建提供者:
<compilation > <buildproviders> <add extension=".mycustomextension" type="System.Web.Compilation.Pagebuildprovider" /> </buildproviders>
试试看,也许这将指出你在正确的方向