cagin
cagin

Reputation: 5920

Could not create type for webservice.asmx

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

Upvotes: 2

Views: 12947

Answers (5)

Talha Baktir
Talha Baktir

Reputation: 41

I think you first of all check namespace asmx.cs same asmx

Upvotes: 1

Sulyman
Sulyman

Reputation: 450

after testing many suggested solutions on the web all the issue was:

every time I was publishing only web service.asmx file

but after republish all the solution it works..because webservice.asmx has its own dll files

Upvotes: 0

Rico Suter
Rico Suter

Reputation: 11858

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...

Upvotes: 4

mvm_bgm
mvm_bgm

Reputation: 153

I believe you have one solution file with webservice and other class libraries and the webservice app consumes the dll from these class libraries. I can see one problem is probably you're using project type as website for webservice which creates problem while resolving type issue for webservice namespace. so the solution would be create a new solution as web application project type and then add the project libraries and it should resolve your issue.

Upvotes: 0

Cinchoo
Cinchoo

Reputation: 6322

Please make sure you deploy the WebService bin folder to the server. I believe it is missing your webservice dlls.

Upvotes: 1

Related Questions