mach2
Mon Jul 18 09:46:09 CDT 2005
Thank you for your post. Well my situation is a bit more complex. I already
have storngname and a full trust on this strong name. The application (smart
client) compiles a code dynamically (Basically a vb class in a text file.
This is a functionality that we provide to our clients so that they could
write reports and make them part of our product) and the compiled code may
access either local files or files on the web server.
I thought of two solutions to these and I think I need your inputs on these
solutions.
1) Generate a key for the clients and when we compile their code use this
key to compile and run. Of course we have to make modifications to client's
security policies. Is this a feasible thing to do? If yes, what would be the
ways to get the key file down to client machines?
2) I tried to call a web service method to read and write files from/to the
web server. On write, I'm getting security exception. Can I enhance security
policy in the web server to give more permission to web service process to
write files in the web server's local file system?
""Jeffrey Tan[MSFT]"" wrote:
> 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.
>
>