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
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