【VisualStudio】 ICSharpCode.SharpZipLib.dllを使用するとコンパイルエラーが発生する
対象製品
SPREAD for ASP.NET 7.0J
状況
修正済み
詳細
ICSharpCode.SharpZipLib.dllを使用するとコンパイルエラーが発生します。
【再現コード】
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim astrFileNames() As String = New String() {Server.MapPath("SharpZipLib_0860.chm")}
Dim strmZipOutputStream As ICSharpCode.SharpZipLib.Zip.ZipOutputStream
strmZipOutputStream = New ICSharpCode.SharpZipLib.Zip.ZipOutputStream(System.IO.File.Create(Server.MapPath("test.zip")))
Try
REM Compression Level: 0-9
REM 0: no(Compression)
REM 9: maximum compression
strmZipOutputStream.SetLevel(9)
Dim strFile As String
Dim abyBuffer(4096) As Byte
For Each strFile In astrFileNames
Dim strmFile As IO.FileStream = System.IO.File.OpenRead(strFile)
Try
Dim objZipEntry As ICSharpCode.SharpZipLib.Zip.ZipEntry = New ICSharpCode.SharpZipLib.Zip.ZipEntry(strFile)
objZipEntry.DateTime = DateTime.Now
objZipEntry.Size = strmFile.Length
strmZipOutputStreaICSharpCode.SharpZipLib.Core.StreamUtils.Copy(strmFile, strmZipOutputStream, abyBuffer)
Finally
strmFile.Close()
End Try
Next
strmZipOutputStream.Finish()
Finally
strmZipOutputStream.Close()
End Try
End Sub
End Class
【再現手順】
1.新規Webフォーム上にSPREADを配置します
2.FarPoint.Excel.dllおよびICSharpCode.SharpZipLibを参照に追加します
3.再現コードをコピー&ペーストしプロジェクトを実行します
-- コンパイルエラーが発生しプロジェクトを実行できません
【再現コード】
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim astrFileNames() As String = New String() {Server.MapPath("SharpZipLib_0860.chm")}
Dim strmZipOutputStream As ICSharpCode.SharpZipLib.Zip.ZipOutputStream
strmZipOutputStream = New ICSharpCode.SharpZipLib.Zip.ZipOutputStream(System.IO.File.Create(Server.MapPath("test.zip")))
Try
REM Compression Level: 0-9
REM 0: no(Compression)
REM 9: maximum compression
strmZipOutputStream.SetLevel(9)
Dim strFile As String
Dim abyBuffer(4096) As Byte
For Each strFile In astrFileNames
Dim strmFile As IO.FileStream = System.IO.File.OpenRead(strFile)
Try
Dim objZipEntry As ICSharpCode.SharpZipLib.Zip.ZipEntry = New ICSharpCode.SharpZipLib.Zip.ZipEntry(strFile)
objZipEntry.DateTime = DateTime.Now
objZipEntry.Size = strmFile.Length
strmZipOutputStreaICSharpCode.SharpZipLib.Core.StreamUtils.Copy(strmFile, strmZipOutputStream, abyBuffer)
Finally
strmFile.Close()
End Try
Next
strmZipOutputStream.Finish()
Finally
strmZipOutputStream.Close()
End Try
End Sub
End Class
【再現手順】
1.新規Webフォーム上にSPREADを配置します
2.FarPoint.Excel.dllおよびICSharpCode.SharpZipLibを参照に追加します
3.再現コードをコピー&ペーストしプロジェクトを実行します
-- コンパイルエラーが発生しプロジェクトを実行できません
回避方法
Service Pack 3(v7.0.4017.2010)で修正済み。