I have a report that was created using v 2008 that included a barcode and it works fine. However when I migrate the report to the newest version the barcode language fails.
The error is "Failed to load expression host assembly. Details could not load file or assembly 'BarcodeLib, Version=1.0.0.22, Culture= neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. HRESULT:0x80131418
I have the following code in the report properties-code:
Public Function Convert(Text As String) As Byte()
Dim b As System.Drawing.Bitmap
' Dim bar As New BarcodeLib.Barcode
bar.Alignment = BarcodeLib.AlignmentPositions.LEFT
bar.IncludeLabel = False
bar.RotateFlipType = Drawing.RotateFlipType.RotateNoneFlipNone
b = bar.Encode(BarcodeLib.TYPE.CODE128, Text, 400, 50)
Dim bitmapData As Byte() = Nothing
Using ms As New System.IO.MemoryStream()
b.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
bitmapData = ms.ToArray()
End Using
Return bitmapData
End Function
I also have the following assemblies:
system.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
BarcodeLib, Version=1.0.0.22, Culture=neutral, PublicKeyToken=null
I have the class as:
BarcodeLib.Barcode bar
What is my issue? and how do I fix this.
Thanks,
Trish
Trish Leppa