Web Service(Web服务)安装部署时,不能与网站(aspx文件)合并到一个虚拟目录下
本人现在一个网站,基本Asp.NET + WebService构建。
项目分两部分,一个是纯网站部分,一个是提供服务的WebService。
现在安装部署时,要以网站形式安装两次,然后再去配置。我觉得这样太繁杂了,想改一种方法,如下:
假设网站名为 Web2008, 提供服务的WebService名为 WS,原来两者是并列的关系,对应于两个虚拟目录。我现在改为:
--
|
Web2008
|__________Index.aspx
|__________Login.aspx
|__________Web.Config(整个网站的配置文件)
|
|__________WS Web服务
|______________Ser1.asmx
|______________Ser2.asmx
|
|______________Web.Config (WebService的配置文件)
然后,运行后就出现问题:
1、Web2008中的 aspx文件运行正常;
2、WS 中的文件不能运行,提示 Web.Config中配置有问题:
Server Error in '/Web2008' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 49: "Passport" and "None"
Line 50: -->
Line 51: <authentication mode="Windows"/>
Line 52: <!-- AUTHORIZATION
Line 53:
我试着把 <authentication mode="Windows"/> 改成为不同的配置,但还是一样的出错。
请问各位:
1、我这样的方案能行得通吗?如果可以,我哪一步错了,应该怎么改?
注意:最好 Web.Config不要合并,因为本系统还有已上线的 C/S版本。
2、如果不能,那是否有其它好一点的解决办法?
3、在打包安装网站时,各位是否还有其它更好的办法?我这样要安装两个网站,实在不爽。
谢谢!