Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET WebService
I have a web application in which i have one web service called WebService.asmx
Now, i have created one windows application and added web reference in it for Webservice.asmx.
When i build this windows application in debug mode, it works fine, also executes properly.
But when i build this application in Release mode, it gives 0 errors and 0 warnings, but when i execute the application, it cant get web reference.
Also, when i try to update web reference, it gives error message as "The HTML document does not contain web service discovery information".
Can anyone tell me, how to solve this problem?
Thanks in advance.
Posted 16-Nov-12 21:10pm
Edited 17-Nov-12 15:26pm
n.podbielski at 17-Nov-12 6:22am
And where is hosted your .asmx?
Sonal Wagh at 17-Nov-12 6:44am
I hosted that web service on IIS. I can access it from browser
n.podbielski at 17-Nov-12 7:02am
But services contains special page with configuration. Maybe this is disabled.
Sonal Wagh at 17-Nov-12 7:10am
I have web service in web application and its configurations are in web.config
n.podbielski at 17-Nov-12 7:43am
Find url to which your windows application is revering and see it is working.
Sergey Alexandrovich Kryukov at 17-Nov-12 21:56pm
There is no such thing as "Release mode". "Release" is just one of the "configuration" names. Usually, in this configuration debug information is not available, full optimization is applied.
It is quite possible to screw up functionality depending on these differences, for example, by using precompiler condition. Without seeing your code, hard to say anything more certain.
@AmitGajjar at 17-Nov-12 22:57pm
do you meant to say, you build application and manually hosted on IIS is working. but publishing is not working ?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I think i got the solution.
The folder which contains web service in web application doesn't have access permissions. so other application cannot access web service, when i added folder permissions in web.config, it is working. Also, i have added protocols in web.config as
        <add name="HttpGet"/>
        <add name="HttpPost"/>
        <add name="HttpSoap"/>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 495
1 Sergey Alexandrovich Kryukov 424
2 OriginalGriff 360
3 Sascha Lefévre 255
4 Abhinav S 250
0 Sergey Alexandrovich Kryukov 10,102
1 OriginalGriff 9,495
2 Peter Leow 5,241
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,076

Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 18 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100