0

I have build a program in Visual Studio. The program creates a logfile and writes into it while the program is running through log4net. Therefore I should set write permissions for my program-folder regardless which user works with the program.

When i am accessing my application it throws me error as

File Access denied

So what i have done it i have given iis_users admin rights there by it works fine...

but my problem is with out setting that rights i should able to run my application through iis

So for i have done

1) Created app.manifest file with code as

 <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the 
            requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            Specifying requestedExecutionLevel node will disable file and registry virtualization.
            If you want to utilize File and Registry Virtualization for backward 
            compatibility then delete the requestedExecutionLevel node.
        -->
         <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

      </requestedPrivileges>

but this does not help me to solve this problem

1
  • You probably should comment on how your application relates to IIS. It is clear that you are not talking about web site/ASP.net or assembly used on a site. On other hand you state "run my application through IIS" which implies some relationship... Jan 11, 2013 at 7:07

1 Answer 1

0

First, you shouldn't be doing that - I mean, writting logs into your program folder. That's what TEMP folders are for.

That said, I think one way to set permission for a file inside your program folder will be to do it in custom action of setup.

Here is a similar question: How to give Read/Write permissions to a Folder during installation using .NET

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.