Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Fri Dec 11, 2015 6:38 pm

I have included Spire.Barcode in a .Net Winforms project and built an installer with Wix.

The application runs fine but no barcodes are being generated on the target platform. I have tested with both x86 and x64 installation targets. The application functions very well running on my development machine.

Only the Spire.Barcode.dll is included in the installation.

Do I need to include additional resources etc for the component to work?

Thanks

chris_watson10
 
Posts: 4
Joined: Wed Sep 23, 2015 8:06 am

Mon Dec 14, 2015 8:43 am

Hi,

You only add Spire.Barcode.dll as references into your window forms project.
Which version of Visual studio you used?
Please kindly notice that Spire.Barcode control cannot be added into Toolbox on VS2010 above version.
If you used VS2010 above version, you can use the following solution to generate barcode image.

Sample code:
Code: Select all
BarcodeSettings setting = new BarcodeSettings();
            setting.Type = BarCodeType.Code128;
            setting.Data = "123456";
            setting.Data2D = "123456";
            setting.ShowText = false;
            BarCodeGenerator generator = new BarCodeGenerator(setting);
            Image barcode = generator.GenerateImage();
            barcode.Save("barcode.png",System.Drawing.Imaging.ImageFormat.Png);


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2448
Joined: Wed Jun 27, 2012 8:50 am

Mon Dec 14, 2015 3:30 pm

Hi Amy,

In fact, using the component is no problem. I have all of the functionality working on my development machine (VS 2015 Pro) and I added all the component programatically etc. with no problem.

My problem is in the deployment phase. I created a Wix Toolset installer for the WinForms application which installed everything on the target PC OK.

But when I go to run the application on the machine I installed the application on, the barcode images are not generated. I have included the barcoding dll in the installation package and it is installed in the same directory as the .exe file.

Is there anything else I should include in the installation package such as licensing files, other DLLs etc or are there any registry entries I shold also create during installation?

Thanks
Chris.

chris_watson10
 
Posts: 4
Joined: Wed Sep 23, 2015 8:06 am

Tue Dec 15, 2015 8:23 am

Hi,

Please share your application to help us to do an investigation.

Thank you.
Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2448
Joined: Wed Jun 27, 2012 8:50 am

Tue Dec 15, 2015 10:07 am

I'm not sure sending you the entire application will help but here is the code we are using to generate a barcode image for printing/print previewing which is where the problem is:

Spire.Barcode.BarcodeSettings bcs = new Spire.Barcode.BarcodeSettings();

transactionItem = 0;

while ((yPos < e.MarginBounds.Height) && (transactionItem < STs.Count))
{
xPos = e.MarginBounds.Left;

// Reel number, attributes, then the barcode between the dates specified and highlight any ERP outages.
Spire.Barcode.BarCodeGenerator bcg = new Spire.Barcode.BarCodeGenerator(bcs);

switch (STs[transactionItem].Type)
{
case StockTransaction.StockTransactionTypeCode.ConsumeReel:
case StockTransaction.StockTransactionTypeCode.ConsumeDuplicateReel:
try
{
bcs.Data = STs[transactionItem].ReelNumber;
bci = bcg.GenerateImage();
e.Graphics.DrawImage(bci, xPos, yPos);
yPos += bci.Height + 10;
xPos = e.MarginBounds.Left + bci.Width + 20;
}
catch
{
// Output a dummy barcode with manual text!
e.Graphics.DrawString("Unable to print this barcode", printFont, printBrush, xPos, yPos);
yPos += (int)e.Graphics.MeasureString($"Unable to print this barcode for primary production order {STs[transactionItem].PrimaryWorksOrderNumber}", printFont).Height;
}
break;

chris_watson10
 
Posts: 4
Joined: Wed Sep 23, 2015 8:06 am

Wed Dec 16, 2015 7:59 am

Hi,

Thanks for providing.
We will do some investigation and tell you when there is any update.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2448
Joined: Wed Jun 27, 2012 8:50 am

Fri Dec 18, 2015 2:54 pm

Do you have an update for me as we are waiting to deploy the application.

Thanks
Chris.

chris_watson10
 
Posts: 4
Joined: Wed Sep 23, 2015 8:06 am

Mon Dec 21, 2015 8:21 am

Hi Chris,

Sorry for the delayed response.
I have tried some test but didn't still reproduce your issue.
Could you please provide us your entire application so that we can reproduce your issue?

And please also provide us your deployment program.

Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2448
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.BarCode

cron