Dav*_*ohn 19 c# asp.net web-services .net-framework-version
错误:无法生成临时类(result = 1)...在Web服务上调用方法时.我正在使用VS 2008 C#ASP.NET 3.5.我正在为我的应用程序调用远程Web服务.
Server Error in '/' Application.
Server was unable to process request. ---> Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\6sbkwt2d.0.cs' could not be found
error CS2008: No inputs specified
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\6sbkwt2d.0.cs' could not be found
error CS2008: No inputs specified
Source Error:
Line 775: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckLogin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 776: public System.Data.DataSet CheckLogin(string uname, string pswd) {
Line 777: object[] results = this.Invoke("CheckLogin", new object[] {
Line 778: uname,
Line 779: pswd});
Source File: c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\14127ae4\96323535\App_WebReferences.u9ldrmk1.0.cs Line: 777
Run Code Online (Sandbox Code Playgroud)
RLH*_*RLH 36
首先,信贷到期的信贷.OP解决了这个问题,并在问题的评论部分回答.但是,据我所知,许多人来到StackOverflow并将阅读问题,而不是查看评论.因此,我在这里转发上述答案.如果这是有用的,请务必向上投票.
出现此问题的原因是与IIS中的Web服务的应用程序池关联的帐户没有该C:\Windows\Temp文件夹的读/写权限.我不知道为什么帐户需要访问此文件夹,但确实如此.从我的随意观察来看,它看起来只是将一个带有随机名称的空文件写入文件Temp夹.
要解决此问题,请浏览到该C:\Windows文件夹,然后右键单击该Temp文件夹.选择" 属性",然后在" 安全"选项卡上添加与Web服务应用程序池关联的帐户.击中OK按钮,进入IIS和回收您的应用程序池.这应该可以修复您的Web服务请求.
值得注意的是,围绕此错误的情况可能有点欺骗性.我在5年内遇到过这个问题几次.(我每次都忘了它.)之所以不那么明显是因为你可以发布一个Web服务,成功浏览到相关asmx页面并查看你的web服务方法的大纲.此外,Visual Studio项目可以添加对Web Service的引用,Visual Studio将自动生成VS项目中Web服务的所有关联类.
这给人的印象是,在您首次请求在Web服务上执行方法之前,一切正常.Web服务在开始执行代码时将失败,因为它希望访问该temp目录.
有关此错误的更多信息,请访问Microsoft.com 上的确认错误报告.
| 归档时间: |
|
| 查看次数: |
23283 次 |
| 最近记录: |