XML形式でリクエストをWebサーバーに送信するWebクライアントがあります。Webサーバーは(かなり大きな)ファイルを作成し、それをキャッシュされたディレクトリに保存して、応答ストリームを介してWebクライアントに返します。これは、最初の数回は正常に機能しましたが、突然機能しなくなり、次の例外(XMLでラップ)が報告されました。
<error type="System.Security.SecurityException">
<message>Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</message>
<stack-trace><![CDATA[ at System.Security.CodeAccessSecurityEngine.Check(Object 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, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Ionic.Zip.SharedUtilities.CreateAndOpenUniqueTempFile(String dir, Stream& fs, String& filename)
at Ionic.Zip.ZipFile.get_WriteStream()
at Ionic.Zip.ZipFile.Save()
at Ionic.Zip.ZipFile.Save(String fileName)
at MyApplication.UpdateItemFiles.GetUpdateContent(XDocument a_xManifest, Stream[] a_arrExtraContent) in C:\Software\MyApplication\Alpha\Web Interface\UpdateItemFiles.aspx.cs:line 265
at MyApplication.UpdateItemFiles.Page_Load(Object sender, EventArgs e) in C:\Software\MyApplication\Alpha\Web Interface\UpdateItemFiles.aspx.cs:line 31]]></stack-trace>
</error>
コードアクセスセキュリティについてはよくわかりません。私はEverybodyにディレクトリの完全な制御を与えることさえ試みました。これは開発サーバーであり、パブリックマシンではないため、これは問題ではありません。なぜこれが最初の数回は機能するのかわかりませんが、今は機能を停止します。
サーバーとクライアント(同じマシン)の両方にWindows764ビットでVisualStudio2008を使用しています。IIS7.0と.NetFramework3.5を使用しています。
編集済み2010/12/1316:05EST:
CodeplexのDotNetZipライブラリを使用しているため、このエラーが発生します。IISまたは私の構成にアセンブリを追加する方法はありますか?