Have asp.net-hosted WinControl write to client's file.

G

Guest

Hello,
I know that you can host a WinControl in ASP.Net. If I want my Windows User
Control to be able to write to the client's file system (or access a
database, or any other secure action), how could I configure security to
allow this? I thought Caspol.exe or the .Net Config Wizards could do this,
but I don't see how.

I get the error: "The application attempted to perform an operation not
allowed by the security policy. The operation required the
SecurityException... System.Security.Permissions.FileIOPermission..."

I've tried (none work):
- using Declarative security in the code, i.e. put the attribute on the
appropriate method:
[Permissions.FileIOPermission(Permissions.SecurityAction.Assert)]
- Use .Net Configuration Wizard > RuntimeSecurityPolicy > Machine >
CodeGroups. I gave the codegroup the Url to match the page with the
WinControl.
- switching the machine.config's process model username to system (more
priviledge).
- setting security in IE.

I've googled on the error and looked at MSDN, and see much stuff for apps
run over a network share, but still don't see a solution for an
asp.net-hosted winControl.

Thanks for any insight.
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top