有没有办法在ASP.NET Web部署项目中摆脱aspx占位符文件? [英] Is there a way to get rid of aspx placeholder files in a ASP.NET web deployment project?

查看:225
本文介绍了有没有办法在ASP.NET Web部署项目中摆脱aspx占位符文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Web部署项目,以便预编译我的 ASP.NET 3.5网络项目。它为aspx和ascx文件中的代码创建了一个额外的DLL。而且,对于每个aspx文件,都有一个需要复制到服务器的占位符aspx文件(空)。



我想简化部署过程。有没有办法(配置IIS网站并添加某种http处理程序等)来删除这些aspx占位符



另外,我想知道是否有办法摆脱bin文件夹中的 .compiled文件。这将使部署过程更加顺利。



谢谢!

解决方案

我自己发现了。这比我想象的容易得多(IIS 6.0):



在Internet Information Manager中,转到站点的属性页面,然后选择主目录选项卡,然后单击在配置...按钮上。



点击编辑...为.aspx ISAPI扩展名,取消选中验证该文件是否存在 / strong>即可。在这一点上,不需要aspx文件。





更新



一件重要的事情是:一个空的default.aspx文件在应用程序的根目录,以允许默认文档的请求,如 http: //www.example.com/ (不调用aspx)。



更新2

$ b另一个非常重要的事情是:如果您使用ASP.NET Ajax PageMethods,那么您必须保留该页面的aspx占位符。如果您省略该文件,JavaScript 'PageMethods是未定义的'错误将被抛出浏览器。


I'm using a web deployment project in order to precompile my ASP.NET 3.5 web project. It creates a single extra DLL for the code in aspx and ascx files. And, for every aspx file there is a placeholder aspx file (empty) which needs to be copied to the server.

I'd like to simplify the deployment process. Is there a way (configuring the IIS site and adding some sort of http handlers etc.) to get rid of these aspx placeholders?

Also, I'd like to know if there is a way to get rid of the .compiled files in the bin folder. It would make the deployment process smoother.

Thanks!

解决方案

I discovered it by myself. It is much easier than I thought (IIS 6.0):

In Internet Information Manager go to the property page of the site, then chose the tab "Home Directory" and click on the button "Configuration...".

Click "Edit..." for the .aspx ISAPI extension and uncheck "Verify that file exists". At this point, no aspx file is needed anymore.

Update

One important thing: I had to create an empty "default.aspx" file in the root of the application in order to allow the default document for requests like "http://www.example.com/" (without calling an aspx).

Update 2

Another very important thing: if you're using ASP.NET Ajax PageMethods, then you have to keep the aspx placeholder of that page. If you're omitting the file, a javascript 'PageMethods is undefined' error will be thrown on the browser.

这篇关于有没有办法在ASP.NET Web部署项目中摆脱aspx占位符文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆