I am using VS 2013 and trying to use ZXing.NET.0.14.0.0 implementation from zxingnet.codeplex.com to create QRCodes. I am getting the error QRCodeWriter.cs not found when executing the code below. Here are the specifics of the error;
Source Not Found
QRCodeWriter.cs not found
You need to find QRCodeWriter.cs to view the source for the current call stack frame
Try one of the following options:
-Browse and find QRCodeWriter.cs...
You can view disassembly in the Disassembly window. To always view disassembly for missing source files. change the setting in the Options dialog.
Source search information
** Here it looks like it is searching through directories to find the file
QRCodeWriter is the method first being used in the example, which is all I am using. Not sure why it's looking for the .cs file though.
Here is the sample code. It is failing on the encode line (3rd line in the 1st example) with the error above.
using ZXing.QrCode;
using ZXing.QrCode.Internal;
namespace QRCodeTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
QRCodeWriter qr = new ZXing.QrCode.QRCodeWriter();
string url = "http://www.bing.com/";
var matrix = qr.encode(url, BarcodeFormat.QR_CODE, 200, 200);
ZXing.BarcodeWriter w = new ZXing.BarcodeWriter();
w.Format = ZXing.BarcodeFormat.QR_CODE;
Bitmap img = w.Write(matrix);
img.Save(@"C:\Users\Frank\Documents\myQR.png", System.Drawing.Imaging.ImageFormat.Png);
}
}
}
Hopefully someone a lot smarter than me can tell me what I am doing wrong here. Thanks in advance!