Web service Parser Error Message: Could not create type 'xxx'

假如想象 提交于 2019-11-30 17:49:24

Please check whether all your dll's are present in the web service folder. i was able to find this with the help of a tool called "Beyond Compare". where i compared older working copy of Web service directory to the new one.

I got the same error, in my case resolution was to use full qualified class name (class name with namespace) in the .asmx file.

<%@ WebService Language="C#" CodeBehind="~/App_Code/AuthenticateUser.cs" Class="AuthenticateUser" %>

would become

<%@ WebService Language="C#" CodeBehind="~/App_Code/AuthenticateUser.cs" Class="MyProjectName.AuthenticateUser" %>

Also, check to ensure that build output path is to the "bin\" folder ONLY. A Web Service project cannot use the DLL files generated if they are stuck under "bin\Debug\AnyCPU" or "bin\Release\x86".

A colleague and myself spent 2 hours trying to make a Web Service project work on a new workstation that had worked perfectly on an old machine.

Hope this tip helps someone else using Google!

I had this problem and I was racking my head for days and doing a lot of research online. It was basically because the file and the class have to be the same name i.e. I had cut the code from somewhere else and the class was called fileUploader. The file was called fileuploader.ashx.

So, that is what was causing my problems. When I renamed the class to fileuploader, it worked perfectly. Ahhhh!! Several days wasted!

Remove sites/Tokhin/ part like this:

then it will work..

The problem is that ASP is looking for a class named AuthenticateUser but it cannot find it.

In Visual Studio, right click on the webservice file (AuthenticateUser.asmx) and select "View Markup". This will let you find Line 1 of the asmx file where the error is. Look at the end of this line. In your example,

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

Check to see the Class matches the Public Class name you gave your webservice. In other words, did you rename the Class to "AuthenticateUser" or to something else after you created this file? Sometimes the class mentioned in Line 1 does not match the name you gave the class in the webservice asmx file.

To fix this problem, the line in the beginning of your webservice should match the class mentioned in Line 1 and look like:

Public Class AuthenticateUser

    ...your webservice code here...

End Class
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!