WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Security IO Problem beim Schreiben eines Logfiles per UNC Pfad (http://www.wcm.at/forum/showthread.php?t=236694)

Flamingdead 15.10.2009 16:11

Security IO Problem beim Schreiben eines Logfiles per UNC Pfad
 
Hi,

ich habe ein kleines Programm geschrieben welches natürlich auch ein Logfile benutzt.
Wenn ich das Programm in einer lokalen Umgebung ausführe funktioniert alles bestens.

Ich muss das aber im Netzwerk starten, also das Logfile wird folgendermaßen erstellt:
Code:

new StreamWriter(@"\\n5200\projekt1\logfile.log", true);
Beim Erstellen des Logfiles gibt es anscheinend ein Problem.. Hier die Exception:

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at ImportVP.Program.Main(String[] args)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
Internet


Wenn ich manuell am \\n5200 files anlegen möchte und bearbeiten, dann habe ich die Berechtigung.
Was kann hier die Lösung sein?

Bitte um Hilfe, ich weis absolut nicht mehr weiter :-(
Vielen Dank schonmal!

spunz 15.10.2009 16:57

für die n5200 kiste im ie zu den trusted zones hinzu.

Flamingdead 15.10.2009 17:07

gleiches Problem, nur steht jetzt in der letzten Zeil der Fehlermeldung "Trusted Zone"
gibts da etwas ganz bestimmtes in der Trusted Zone das ich dann einstellen kann?

spunz 15.10.2009 20:59

http://blogs.msdn.com/shawnfa/archiv.../20/57023.aspx


Alle Zeitangaben in WEZ +2. Es ist jetzt 19:57 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag