Hi mach2,
Thanks for your post.
Yes, normally, no touch deployed application will have a restricted
permission right at client side. So when we use WebClient.UploadFile
method, a SecurityException may arise.
For this issue, we may setup the client .Net code access security setting
to grant certain permission to our smart client application. This requires
2 steps:
1. Open .Net configuration tool 1.1, create a least required permission
set(for WebClient.UploadFile, I think we should assign "Web Access" or
"File IO" permissions), you can also assign Full Trust as a test purpose.
2. create a code group for our application.(we can use certain feature of
our application as the code group condition, for example Application site
URL, strong name etc..). At last, we can assign the #1 step created
permission set to this code group.
Then our application will fail into this code group and have the permission
set we specified. And the original exception will go away.
You can get more information about .Net Code Access Security in the article
below:
"Understanding .NET Code Access Security"
http://www.codeproject.com/dotnet/UB_CAS_NET.asp
Hope this helps
=======================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.