Reputation: 5920
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
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
Reputation: 11858
I had the same error...
I solved it by changing the properties of my Xzy.asmx
file:
Build Action
to Content
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
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
Reputation: 6322
Please make sure you deploy the WebService bin folder to the server. I believe it is missing your webservice dlls.
Upvotes: 1