iis - WCF - Access Denied when creating folder -


i've built wcf service , want host on iis. 1 of features want programmatically create subfolder in wcf webhost root, persist json files.
i've tested on local dev iis express , works fine, no surprise 'cause have necessary permissions.
now, want publish on public domain. this, i've created subdomain on plesk , subfolder within httpdocs. i've copied web.config file , bin folder dev machine folder on domain. but, when enter svc url on browser access denied exception (the folder created in dependency injected in service, that's why exception @ point).

server error in '/' application.

access path 'c:\inetpub\vhosts\««my domain»»\httpdocs\versioningservice\repository' denied.

description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.

exception details: system.unauthorizedaccessexception: access path 'c:\inetpub\vhosts\««my domain»»\httpdocs\versioningservice\repository' denied.

below web.config:

<?xml version="1.0"?> <!--   more information on how configure asp.net application, please visit   http://go.microsoft.com/fwlink/?linkid=169433   --> <configuration>   <system.web>     <compilation debug="false" targetframework="4.5" />     <httpruntime targetframework="4.5" />     <customerrors mode="off"/>   </system.web>    <system.servicemodel>     <servicehostingenvironment aspnetcompatibilityenabled="false" multiplesitebindingsenabled="true">       <serviceactivations>         <add factory="versioningservice.services.manualmajorminorversioninghostfactory"              relativeaddress="~/manualmajorminorversioning.svc"              service="versioningservice.services.manualmajorminorversioning" />       </serviceactivations>     </servicehostingenvironment>     <behaviors>       <servicebehaviors>         <behavior>           <servicemetadata httpgetenabled="true" />         </behavior>       </servicebehaviors>     </behaviors>   </system.servicemodel> </configuration> 

this use current assembly path:

var assemblyfolder = path.getdirectoryname(assembly.getexecutingassembly().codebase); 

note: if use programdata folder no exception, prefer have subfolder within wcf folder.

this permissions issue. need add else web.config?
do need ask host provider give permissions user?


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -