读书人

Asp.net下发布Webservice报错Could no

发布时间: 2012-03-02 14:40:28 作者: rapoo

Asp.net下发布Webservice报错Could not create type
win7 IIS 7.5 vs2010 asp.net4.0下

发布Webservice时,我在VS2010里发布网站的路径是D:\Project\WebServices\PrecompiledWeb\QueryWebSite,在实际IIS中配置网站是,我设置的物理路径是D:\Project\WebServices\PrecompiledWeb,结果QueryWebSite下的资源都不能访问了,其中在访问Service.asmx是报错如下:

Server Error in '/' Application.

--------------------------------------------


Parser Error

Description:
An error occurred during the parsing of a resource required to service this
request. Please review the following specific parse error details and modify
your source file appropriately.



Parser Error Message: Could not
create type 'Service'.

Source Error:















Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" class="Service" %>


Source File:
/QueryWebSite/Service.asmx Line: 1






--------------------------------------------

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET
Version:4.0.30319.225

[解决办法]
你的虚拟路径对应的不是 D:\Project\WebServices\PrecompiledWeb ?
[解决办法]
根据下面的讨论

http://social.msdn.microsoft.com/forums/en-US/asmxandxml/thread/838706ac-6763-455b-95bd-1432a9ccc6be/

不是不Asp.net的版本不对了。在站点属性的Asp.net页中可以设置。

读书人网 >Web Service

热点推荐