wcf - How to solve this error "AddressAccessDeniedException" when using Azure? -


i have wcf service hosted in asp.net web application, running in azure app service.

there no errors when run project in local machine. when deployed azure, have following error:

[addressaccessdeniedexception: http not register url http://+:80/docs/. process not have access rights namespace (see http://go.microsoft.com/fwlink/?linkid=70353 details).]

there plenty of posts error regarding of local machines, not related azure. theu suggest run netsh give permission url, dont know how in azure.

in fact trying use swagger wcf implementation, , error occurs in code:

global.asax.cs:

void application_start(object sender, eventargs e) {     // swagger     routetable.routes.add(new serviceroute("api-docs", new webservicehostfactory(), typeof(swaggerwcfendpoint)));     var swaggerhost = new webservicehost(typeof(swaggerwcfendpoint));     swaggerhost.open();   } 

web.config:

<services>   <service name="swaggerwcf.swaggerwcfendpoint">     <endpoint address="http://totvsrmwebapp.azurewebsites.net/docs" binding="webhttpbinding" contract="swaggerwcf.iswaggerwcfendpoint" />   </service> </services> 

here stack trace:

'[httplistenerexception (0x5): access denied]    system.net.httplistener.setupv2config() +333    system.net.httplistener.start() +297    system.servicemodel.channels.sharedhttptransportmanager.onopen() +651  [addressaccessdeniedexception: http not register url http://+:80/docs/. process not have access rights namespace (see http://go.microsoft.com/fwlink/?linkid=70353 details).]    system.servicemodel.channels.sharedhttptransportmanager.onopen() +1473    system.servicemodel.channels.transportmanager.open(transportchannellistener channellistener) +296    system.servicemodel.channels.transportmanagercontainer.open(selecttransportmanagerscallback selecttransportmanagercallback) +122    system.servicemodel.channels.transportchannellistener.onopen(timespan timeout) +64    system.servicemodel.channels.httpchannellistener`1.onopen(timespan timeout) +67    system.servicemodel.channels.communicationobject.open(timespan timeout) +308    system.servicemodel.dispatcher.channeldispatcher.onopen(timespan timeout) +61    system.servicemodel.channels.communicationobject.open(timespan timeout) +308    system.servicemodel.servicehostbase.onopen(timespan timeout) +136    system.servicemodel.channels.communicationobject.open(timespan timeout) +308    rmwcfwebapp.global.application_start(object sender, eventargs e) +236  [httpexception (0x80004005): http not register url http://+:80/docs/. process not have access rights namespace (see http://go.microsoft.com/fwlink/?linkid=70353 details).]    system.web.httpapplicationfactory.ensureappstartcalledforintegratedmode(httpcontext context, httpapplication app) +9982013    system.web.httpapplication.registereventsubscriptionswithiis(intptr appcontext, httpcontext context, methodinfo[] handlers) +118    system.web.httpapplication.initspecial(httpapplicationstate state, methodinfo[] handlers, intptr appcontext, httpcontext context) +172    system.web.httpapplicationfactory.getspecialapplicationinstance(intptr appcontext, httpcontext context) +336    system.web.hosting.pipelineruntime.initializeapplication(intptr appcontext) +296  [httpexception (0x80004005): http not register url http://+:80/docs/. process not have access rights namespace (see http://go.microsoft.com/fwlink/?linkid=70353 details).]    system.web.httpruntime.firstrequestinit(httpcontext context) +9963380    system.web.httpruntime.ensurefirstrequestinit(httpcontext context) +101    system.web.httpruntime.processrequestnotificationprivate(iis7workerrequest wr, httpcontext context) +254' 

i have reproduced issue. based on experience, azure web app not give permission register url "http://totvsrmwebapp.azurewebsites.net/docs". if want this, recommend use azure cloud service, , execute command (netsh http add urlacl url=) in start task. more information cloud service, please refer this article. , have @ this article know how use start task.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -