XML 형식의 요청을 웹 서버에 보내는 웹 클라이언트가 있습니다. 웹 서버는 (다소 큰) 파일을 만들어 캐시 된 디렉토리에 저장하고 응답 스트림을 통해 웹 클라이언트에 반환합니다. 이 잘 나는 그것을 시도 처음 몇 시간을 일하지만, 갑자기 그것이 작동을 중지하고 (XML에 싸여) 다음과 같은 예외가보고 :내 ASPX 페이지가 웹 서버의 디렉토리에 액세스 할 수없는 이유는 무엇입니까?
<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>
내가 코드 액세스 보안에 대해 잘 모르겠어요. 나는 심지어 모든 사람에게 디렉토리에 대한 모든 권한을 부여하려고 노력했습니다. 이것은 개발 서버이며 공용 컴퓨터가 아니기 때문에 문제가되지 않습니다. 나는 이것이 왜 처음 몇 시간 동안 효과가 있었는지 이해하지 못한다. 그러나 지금 일하는 것을 그만 둔다.
저는 Windows 7 64 비트에서 Visual Studio 2008을 서버와 클라이언트 (동일한 컴퓨터)에 사용하고 있습니다. IIS 7.0과 .Net Framework 3.5를 사용하고 있습니다.
편집 2010년 12월 13일 동부 표준시 16시 05분 : 내가는 CodePlex에서 DotNetZip 라이브러리를 사용하고 있기 때문에이 오류를 받고 있어요
. IIS 나 구성에 어셈블리를 추가 할 수 있습니까?
아니야. –
SQL Server를 사용하고 있어야합니다. 맞습니까? – Jordan