Click here to Skip to main content
11,644,731 members (58,070 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: security
I have Framework 3.5, Windows 7 Premium edition.
Use VS 2008, C#.

I want to use a OpenFileDialog in my web site (now tested on my own computer).
Also using files.

When I had just assigning filename to the class of OpenFileDialog, I have got an exception :
request for the permission of type ',mscorlib, version =, Culture = neutral,PublicTokenKey=b77a5c561934e089' failed.

I see some solution, that lead me to insert on top of my method :
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]

(I don't know whether following on top of my method is also ok :
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert, Unrestricted = true)])

Also on assemblyinfo.cs :
[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted = false, Write = "c:\\MyFolder"

But the above make me access the web-page, but I can see nothing
(I think there is an exception, but don't know how to check that).

I want to know, whether I can configure something in web.config,
and put there my own permission-set (I don't know whether permission-set object give me an answer).
I need also a full tutorial for web.cofig.

Thanks Smile | :)
Posted 1-Nov-10 10:53am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this post[^] which has answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 680
1 494
2 Sergey Alexandrovich Kryukov 454
3 Afzaal Ahmad Zeeshan 404
4 CPallini 386
0 OriginalGriff 1,020
1 Sergey Alexandrovich Kryukov 673
2 DamithSL 656
3 Afzaal Ahmad Zeeshan 652
4 CPallini 555

Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 17 Nov 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100