发布Webservice时,我在VS2010里发布网站的路径是D:\Project\WebServices\PrecompiledWeb\QueryWebSite,在实际IIS中配置网站是,我设置的物理路径是D:\Project\WebServices\PrecompiledWeb,结果QueryWebSite下的资源都不能访问了,其中在访问Service.asmx是报错如下: Description:
win7 IIS 7.5 vs2010 asp.net4.0下Server Error in '/' Application.
Parser Error
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
你这个不是Project类型的项目,估计需要把代码一起拷贝到IIS上,建立一个可以编译的WEB项目最方便