.NET 3.5 Build

Nov 28, 2011 at 1:17 PM

Great library, I hope the project maintains some momentum.

Are there any plans to create a .NET 3.5 compatible release?  There isn't much use of .NET 4 specific functionality so changing the target framework to 3.5 for the encoding project wouldn't require much effort but would allow a wider audience to use the library in their applications.

Coordinator
Nov 30, 2011 at 9:27 AM

You can try compile under .Net 3.5. I just made a copy of project then use sharpdeveloper 4.0 change project to .Net 3.5. Convert successfully without any issue. Most our code under Encoder is not specifically using 4.0 unique method. So normal convert and then compile should work for now, and let me know if there is any issue. 

Nov 30, 2011 at 10:20 AM

Thanks for the reply.  

Yes I've already converted the Encoding and Demo projects to target .NET 3.5 in Visual Studio.  I changed this in the project properties without having to use any other tools.  This resulted in just two compile errors because of calls to .NET 4 specific methods.  For example String.IsNullOrWhiteSpace, but these were easy to work around.

That's not really the problem, I was aware I could do this and I did.  The problem is that I would have to do this every time I get the latest version of the library in the future, for bug fixes, features etc, which because of the overhead, is discouraging. 

My point is, have you considered switching the target framework to .NET 3.5 since you are not really using any major .NET 4 API's or C# 4 language features?  Like I said this would open up the library to a much wider audience, as it's not always possible or straightforward to move to .NET 4 for some applications and/or environments (think big corporate IT).  

Coordinator
Nov 30, 2011 at 11:16 AM

I don't mind change it to .Net 3.5 project. Like you what you have said above.  

Is that OK to send your converted project to me? As I don't have VS 2010, I'm not sure if there are any compatibility issue with Sharpdevelop's conversion function. 

Also please list the locations of compile errors, so I could check out. 

Thanks for suggest.

Coordinator
Nov 30, 2011 at 10:04 PM

I have just rechecked goal of this project which set up by gmamaladze. One of them is that this library should be support windows phone 7.  I'm not experienced with Windows phone 7 development. From the document I have found online it looks like it will be good to develop under .Net 4.0 environment.

http://msdn.microsoft.com/en-us/library/gg490765.aspx

http://dotnet.dzone.com/articles/not-every-library-will-work

Even though we don't use .Net 4.0 specifically API much, but as assembly side after compile there should be some difference. Fix me if I'm wrong. Thus it is probably good idea to stay and develop under .Net 4.0 and try to get some 3.5 convert version working during major release.  

Dec 1, 2011 at 9:32 AM

I haven't done any WP7 dev (but would like to).  However as I understand it, WP7 applications target .NET Compact Framework 3.7, and support a subset of Silverlight 3.  Therefore I don't think this library would actually work as it stands now since you are using some .NET 4 specific methods.  Also for example the encoding library includes a Windows Forms control which references the System.Windows.Forms namespace.  I don't believe this would work on WP7, but I'm not sure.

I think if that's your real goal you should consider the way the solution is set-up as well.  Maybe consider splitting out the encoding library into several smaller projects.  For example, move the rendering control to a separate windows form library, a separate ASP.NET library and possibly a WP7 library as well with the core encoding library being non platform specific. For example, you could easily take the bit matrix from a qr code and write platform specific rendering code.  Provided the core library is using the lowest common denominator, that is to say CF 3.7 features than it should be compatible with all target platforms.

Also I don't believe you'd actually want to create a WP7 app that generated a QR code, you would only want to read/decode QR codes from a phone right?  Therefore it doesn't make sense to have the rendering code in the core library or targeting WP7.  

These are just suggestions, I hope they make sense and help.  If I can contribute to the project in any other way I'd be happy to do so.  Like I said it's already a great library at this early stage.  My suggestions are intended to help you reach a larger audience of users.

Coordinator
Dec 1, 2011 at 10:27 AM

You can submit request to gmamaladze to become one of developer. 

From link I post above, Windows phone 7 developer guide from MSFT. One of system requirement is Microsoft .NET Framework 4.0 or later. Also as I search around, .Net compact 3.7 is not yet released version. 

It's true that current control is for windows form. Which gmamaladze made it for demo, and then someone request to put that control and render class into encoder assenbly. That's how it end up. WPF control should be next goal after finish encoder part. 

Currently, I'm still trying to finish encoder, as all the code for windows form control is still base on ZXing's C# code wrap. We are trying to rewrite it to native .Net based code instead of port from Java. For reason we rewrite ZXing's code you can check gmamaladze's codeproject page. 

http://www.codeproject.com/Articles/258779/Just-launched-new-open-source-project-QrCode-Net-a.aspx

He is currently busy at moment, you can message him through codeplex and ask his opinion on framework for this project. I'm not experienced with WP development, so for now I will try to limit the use of .Net 4 specific methods and finish encode part first. 

Thanks for suggestion though. Really appreciated. 

Regard

Jason

Dec 1, 2011 at 11:08 AM

I'll contact gmamaladze (maybe after Christmas) to become a contributing dev.

Regarding the two changes I made to the Encoder library to make it compile under .NET 3.5:

1 - \Windows\Controls\QRCodeControl.cs(42) - I had to change the IsNullOrWhiteSpace method to

if (String.IsNullOrEmpty(this.Text) || (this.Text.Trim() == String.Empty))

2 - \Masking\Scoring\MatrixScoreCalculator.cs(14) - I had to change .OrderByDescending(PenaltyScore) to .OrderByDescending(p => p.PenaltyScore())

Note that the line numbers might be slightly off, this was based on the source taken on Monday November 28th approx.

Thanks again, S

Coordinator
Dec 2, 2011 at 2:38 AM

Ok. I will take look and apply those changes. 

Thanks for report. 

Jan 18, 2012 at 8:02 AM

HI!

I found one more compile error. .Net 3.5 framework don't have string.Join method, which is used in VersionDetail.cs.

I propose to use this.Version + ";" + this.NumTotalBytes + ";" + this.NumDataBytes + ";" + this.NumECBlocks; instead of string.Join(";", this.Version, this.NumTotalBytes, this.NumDataBytes, this.NumECBlocks);

Coordinator
Jan 19, 2012 at 3:35 AM

Check in 11737.

Thanks for report.