Visual Studio 2005 - adding web link fails for secure webservice

I have a webservice (asmx file) in a directory that requires authentication

When I try to add a WebReference via VS2005, I get the following error:

The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/webchat/login.aspx?ReturnUrl=%2fwebchat%WebService.asmx">here</a>.</h2>
</body></html>

      

When I remove the web.config in that directory (and basically removing the requirement for authentication) everything works fine. I can add WebReference.

Any idea?

0


source to share


1 answer


Place the following code in your web.config:

<location path="path/to/your/service.asmx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

      



ASP.Net allows you to override application settings for specific locations.

+2


source







All Articles