简体   繁体   English

浏览Web服务以及如何在IIS 7.5中配置网站时出错

[英]Error browsing web service and how to configure web site in IIS 7.5

I have a problem. 我有个问题。 We recently migrated our web site solution from asp.net 3.5 to asp.net 4.0. 最近,我们将网站解决方案从asp.net 3.5迁移到了asp.net 4.0。 The web site have a web service that I have added a new method to. 该网站有一个Web服务,我向其中添加了新方法。

On my local machine (Windows 7, VS 2010,.NET 4.0, IIS 7.5), I have no problem browsing our web service when I use the Visual Studio Development Server, but when I check the "Use Local IIS Web server" option in the web project, I get an error saying: 在我的本地计算机(Windows 7,VS 2010,.NET 4.0,IIS 7.5)上,当我使用Visual Studio开发服务器时,但在选中“使用本地IIS Web服务器”选项时,浏览Web服务没有问题。 Web项目中,我收到一条错误消息:

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 'braArkivWS.Services'. 解析器错误消息:无法创建类型'braArkivWS.Services'。

Source Error: 源错误:

Line 1: <%@ WebService Language="C#" CodeBehind="Services.asmx.cs" Class="braArkivWS.Services" %> 第1行:<%@ WebService Language =“ C#” CodeBehind =“ Services.asmx.cs” Class =“ braArkivWS.Services”%>

Source File: /braArkivWeb/Service/Services.asmx Line: 1 源文件:/braArkivWeb/Service/Services.asmx行:1


Version Information: Microsoft .NET Framework Version:4.0.30319; 版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET Version:4.0.30319.1 ASP.NET版本:4.0.30319.1

The Event Viewer has a more "descriptive" error message: 事件查看器具有更多“描述性”错误消息:

Event code: 3006 Event message: A parser error has occurred. 事件代码:3006事件消息:发生解析器错误。 Event time: 17.08.2010 08:12:11 Event time (UTC): 17.08.2010 06:12:11 Event ID: b350253d265743c0925f92024a8c1dcf Event sequence: 3 Event occurrence: 1 Event detail code: 0 事件时间:17.08.2010 08:12:11事件时间(UTC):17.08.2010 06:12:11事件ID:b350253d265743c0925f92024a8c1dcf事件顺序:3事件发生:1事件详细代码:0

Application information: Application domain: /LM/W3SVC/1/ROOT/braArkivWeb/Service-1-129264991310980968 Trust level: Full Application Virtual Path: /braArkivWeb/Service Application Path: D:\\dev\\braArkiv\\dev\\braArkivWeb\\braArkivWeb\\Service\\ Machine name: GEO-TD-543807 应用程序信息:应用程序域:/ LM / W3SVC / 1 / ROOT / braArkivWeb / Service-1-129264991310980968信任级别:完整应用程序虚拟路径:/ braArkivWeb / Service应用程序路径:D:\\ dev \\ braArkiv \\ dev \\ braArkivWeb \\ braArkivWeb \\服务\\机器名称:GEO-TD-543807

Process information: Process ID: 8032 Process name: w3wp.exe Account name: NT AUTHORITY\\NETWORK SERVICE 进程信息:进程ID:8032进程名称:w3wp.exe帐户名:NT AUTHORITY \\ NETWORK SERVICE

Exception information: Exception type: HttpParseException Exception message: Could not create type 'braArkivWS.Services'. 异常信息:异常类型:HttpParseException异常消息:无法创建类型'braArkivWS.Services'。 at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName) at System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly) at System.Web.Compilation.SimpleHandlerBuildProvider.GetGeneratedType(CompilerResults results) at System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) at System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpC 在System.Web.UI.SimpleWebHandlerParser.GetType(字符串typeName)在System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(组件buildAssembly)在System.Web.Compilation.SimpleHandlerBuildProvider.GetGeneratedType(CompilerResults结果)在System.Web.Compilation.BuildProvider System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults结果)的System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)的System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath,布尔值noBuild的.CreateBuildResult(CompilerResults结果) ,位于System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext上下文,VirtualPath virtualPath,布尔值noBuild,布尔值allowCrossApp,布尔值allowBuildInPrecompile,布尔值throwIfIsToTo的System.Web.Compilation.BuildManager。 Compilation.BuildManager.GetVPathBuildResult(HttpC ontext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) at System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) at System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType(String url, HttpContext context) at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ontext上下文,VirtualPath virtualPath,布尔noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile,布尔sureIsUpToDate)在System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext上下文,VirtualPath虚拟路径)在System.Web.UI.WebServiceParser.GetCompiledType(字符串inputFile,HttpContext System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType(String url,HttpContext上下文)的System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(System.Web的HttpContext上下文,字符串动词,字符串url,字符串filePath) System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()的.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext上下文,字符串requestType,字符串url,字符串pathTranslated)在System.Web.HttpApplication.ExecuteStep( IExecutionStep步骤,布尔值和已同步完成)

Request information: Request URL: http://localhost/braArkivWeb/Service/Services.asmx Request path: /braArkivWeb/Service/Services.asmx User host address: ::1 User: 请求信息:请求URL: http://localhost/braArkivWeb/Service/Services.asmx请求路径:/braArkivWeb/Service/Services.asmx用户主机地址::: 1用户:
Is authenticated: False Authentication Type: 已认证:错误认证类型:
Thread account name: NT AUTHORITY\\NETWORK SERVICE 线程帐户名称:NT AUTHORITY \\ NETWORK SERVICE

Thread information: Thread ID: 5 Thread account name: NT AUTHORITY\\NETWORK SERVICE Is impersonating: False Stack trace: at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName) at System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly) at System.Web.Compilation.SimpleHandlerBuildProvider.GetGeneratedType(CompilerResults results) at System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) at System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecomp 线程信息:线程ID:5线程帐户名:NT AUTHORITY \\ NETWORK SERVICE正在模拟:False堆栈跟踪:在System.Web.UI.SimpleWebHandlerParser.GetType(String typeName)在System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly )在System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results)在System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results)在System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results)在System.Web.Compilation。 System.Web.Compilation.BuildManager。上下文VirtualPath virtualPath,布尔值noBuild,布尔值allowCrossApp,布尔值allowBuildInPrecomp ile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) at System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) at System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType(String url, HttpContext context) at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context,VirtualPath virtualPath,Boolean noBuild,Boolean allowCrossApp,Boolean allowBuildInPrecompile,Boolean sureIsUpToDate),System.Web.Comp.ationContext.BuildManager.GetVPathBuild() ,位于System.Web.UI.WebServiceParser.GetCompiledType(字符串inputFile,HttpContext上下文)处的System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType(字符串url,HttpContext上下文)处的System.Web.Services.Protocols.WebServiceHandlerFactory处的VirtualPath virtualPath) System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext上下文,字符串动词,字符串url,字符串filePath)在System.Web.HttpApplication.MaterializeHandlerExecutionStep.System处的.GetHandler(HttpContext上下文,字符串requestType,字符串url,字符串pathTranslated) System.Web.HttpApplication.ExecuteStep(IExecutionStep)上的.Web.HttpApplication.IExecutionStep.Execute() step, Boolean& completedSynchronously) 步骤,布尔值和已完成同步)

I made an Application Pool for the web site in IIS that use the asp.net 4.0 runtime and that run in the classic mode. 我为使用asp.net 4.0运行时并以经典模式运行的IIS中的网站制作了一个应用程序池。 Before we migrated to asp.net 4.0 we used an application pool with the asp.net 2.0 runtime. 在迁移到asp.net 4.0之前,我们将应用程序池与asp.net 2.0运行时一起使用。 I guess it has something to do with that, but I don't know much about configuring IIS 7.5 to know how to deal with this problem. 我想这与它有关,但是我对配置IIS 7.5知道如何处理这个问题并不了解。

Could anyone help me? 有人可以帮我吗?

Best regards. 最好的祝福。

Update: Success! 更新:成功!

I don't know what I did wrong the first time, probably some setting in my IIS, but when I reinstalled IIS 7.5 and ran aspnet_regiss -i for asp.net 4.0, I was able to browse my asmx service successfully:) 我不知道我第一次做错了什么,可能是我的IIS中有一些设置,但是当我重新安装IIS 7.5并为asp.net 4.0运行aspnet_regiss -i时,我能够成功浏览我的asmx服务:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM