C# – Could not create type for webservice.asmx

asmxcvisual studio 2010web services

I have a web service and it uses some other projects dll files. Everything is ok when it runs on my lochal server. But when I deploy to server, I have this error.

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 'Dos.Service.Web.WS.DosMainWebService'.

Source Error:

Line 1: <%@ WebService Language="C#" CodeBehind="DosMainWebService.asmx.cs" Class="Dos.Service.Web.WS.DosMainWebService" %>

Source File: /ws/WS/DosMainWebService.asmx Line: 1

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

Best Answer

I had the same error...

I solved it by changing the properties of my Xzy.asmx file:

  • Set Build Action to Content
  • Set Copy to Output Directory to Copy if newer (in my case it was set to "Do not copy")

I hope this helps anyone...

Related Topic