Web Service(Web服务)安装部署时,不能与网站(aspx文件)合并到一个虚拟目录下

jozosoft 2008-08-20 07:51:44
本人现在一个网站,基本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、在打包安装网站时,各位是否还有其它更好的办法?我这样要安装两个网站,实在不爽。

谢谢!
...全文
184 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluejingling 2008-12-24
  • 打赏
  • 举报
回复
MS不行。一个网站里只能有一个WebConfig吧
帮顶一下。
heart_string 2008-08-29
  • 打赏
  • 举报
回复
ding
fejay 2008-08-21
  • 打赏
  • 举报
回复
帮顶
jozosoft 2008-08-21
  • 打赏
  • 举报
回复
不能让我的问题沉了下去!

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧