How do I deploy a pre-compiled ASP.NET web application?

*爱你&永不变心* 提交于 2019-12-10 10:29:41

问题


I have a web service implemented in ASP.NET 2.0 and have pre-compiled it using the aspnet_compiler.

I have no clue now how to deploy it to IIS, can someone point me in the right direction? I am using IIS 6.0 on a Windows Server 2003 machine.

I have placed the pre-compiled files into a virtual directory, when I access the service through the browser I get the following parser error message:

Parser Error Message: The page must have a 
<%@ webservice class="MyNamespace.MyClass" ... %> directive.

I then checked the .asmx file for said directive and the contents have been changed by the compiler to:

This is a marker file generated by the precompilation tool, and should not be deleted!

UPDATE: When I place the non-pre-compiled web app in the virtual directory it works fine, when I place the pre-compiled wen app in the virtual directory, I get the above errors.

Anyone have any ideas!?


回答1:


You can either copy the contents of the output directory into the virtual directory on IIS and it should all just work. You will need to set up the App Pool and configure the virtual directory for ASP.NET just like a non-compiled website. Make sure you delete everything from the virtual directory (if there was a previous non-compiled site there).

Also you can use Web Deployment projects, which can serve as an input to an MSI installer.

The ASMX file contents are correct. Are you sure you have configured the Virtual Directory with an Application? Open the properties window by right clicking on the virtual directory and ensure the "Application Name" (on the "Virtual Directory" tab) is set and is editable.

Also have chosen the correct ASP.NET version on the tab? Check this on the "ASP.NET" tab of the properties window"




回答2:


did you deploy the entire bin directory? You need to make sure the .COMPILED files created by aspnet_compiled are in your bin dir.



来源:https://stackoverflow.com/questions/459573/how-do-i-deploy-a-pre-compiled-asp-net-web-application

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