Red Gate forums :: View topic - Referencing SDK for Trial
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

Referencing SDK for Trial

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Sun Apr 01, 2012 6:16 am    Post subject: Referencing SDK for Trial Reply with quote

I've been wanting to try out the SQL Comparison SDK, and have been having issues.

I reference the components as per the documentation and it compiles fine.

When I execute the code, it gets to any Redgate object (such as Database) that invokes licensing, and it pops up the Licensing window (the one where you can activate the product, or "skip" it for a 14 day trial).

I choose skip and immediately get the below error:


[code]Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: format
at System.String.Format(IFormatProvider provider, String format, Object[] arg
s)
at RedGate.SQLToolkit.Engine.Licensing.ToolkitLicenceProvider.GetLicense(Lice
nseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseCont
ext context, Type type, Object instance, Boolean allowExceptions, License& licen
se, String& licenseKey)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at RedGate.SQLCompare.Engine.Database..ctor()
at Program.Program.Main(String[] args)[/code]


I don't have a license to activate it (haven't decided if this is useful to code the API directly) but I just can't get the SDK to work by using the SKIP option.

I've tried Windows XP, Windows 7, formatted and resintalled a dev computer, tried every single .net Framwork and service pack, multiple versions of Visual Studio 2010/2008. The above example was written in notepad to remove possible VS issues. I've compiled under .net 2.0, 3.0, 3.5, 4.0.

I've tried adding licenses.licx files and played with it, even manually licensing the code itself.

But no matter what, the above error persists whenever it touches a object with the Licensing attribute on it.

I'm sure I've done massive overkill in debugging this. I've looked through all the requirements for MDAC, .net, OS, that is listed for this product, but I cannot find a way to make it work.

I'm sure it's something simple that's I've screwed up, I'd love to know what it is.

Thanks.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Mon Apr 02, 2012 4:33 pm    Post subject: Reply with quote

Looks like one of those annoying .NET resource problems. Are you building your application against .NET 2,3,or 4? It's trying to get some text out of the embedded resources in the SQLCompare.Engine dll and not finding them - I am guessing because they are in a resx compatible with .NET 2 and 3.
Back to top
View user's profile Send private message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Mon Apr 02, 2012 6:02 pm    Post subject: Reply with quote

I tried compiling it as just a standard console application.

1) Reference the RedGate.Shared.SQL, RedGate.Shared.Utils, and RedGate.SQLCompare.Engine (I also reference System.Web as some components internally reference it), from the Sql Comparison SDK/assembly folder from the SDK install.

2) In code, create an instance of the Database class.

3) On execution, it pops up the licensing window, I choose "Skip".

4) Above exception is thrown, with the "null" issue with the format parameter.

RedGate.SQLCompare.Engine (v. 10.0.0.192) appears to be targeting framework (v2.0.50727). I've targeted my executable to target .net 2.0, 3.0, 3.5, 4.0, and each time I get the same above error.

I've also added references to everything in the assembly folder (.Rewriter, .Licensing, .ASTParser) in case there was a dependency there, but has not resolved the exception.
Back to top
View user's profile Send private message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Mon Apr 02, 2012 6:18 pm    Post subject: Reply with quote

As an addendum, I've also added a licenses.licx as an embedded resource as a test. It pops up the license/skip window as before, however this is at compile time, not run time. I choose skip, and it continues without an error.

When I attempt to execute the line of code that creates an instance of the Database class, it doesn't prompt for licensing, but the exception pops up immediately (null for format parameter).
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Mon Apr 02, 2012 6:18 pm    Post subject: Reply with quote

Ok, I have logged a bug for this. I don't think the strings that need to be displayed when the trial expires are avaulable in the form's resources.
Back to top
View user's profile Send private message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Mon Apr 02, 2012 7:07 pm    Post subject: Reply with quote

Is it that it's trying to display that the trial time period has expired? Or is it just preloading that information to display to the user if the trial has expired?

I only ask because this was recently loaded onto a dev box that's never used it before, and the window still states its under a 14 day trial (we've never actually been able to trial it, so I don't know if it should be decrementing time at this point or how your internal licensing works).

But I appreciate you listing it as a bug, we've tried it several different ways and just can't figure out what we're doing wrong.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Tue Apr 03, 2012 9:07 am    Post subject: Reply with quote

It's conditionally trying to load the string for either "trial has expired" or "trial will expire". Strange thing is you're the only person who has reported it so far and it looks to me like it should affect everybody.
Back to top
View user's profile Send private message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Wed Apr 04, 2012 5:40 pm    Post subject: Reply with quote

As a test I installed Sql Compare 8.50.25.11 and implemented the exact same code with the API from that version.

The Database object is created, the licensing/trial popup lets me choose activate or skip, after skip is chosen, the code continuesto run (with the trial popup message box popping up) and the test code "works".

So it seems that I can get the older version to work, but I still can't get Sql Comparison SDK 10 to work without that weird licensing window exception.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Wed Apr 04, 2012 5:59 pm    Post subject: Reply with quote

Yes, that's correct. SDK 10 has a bug in it. I am trying to get someone to look at it as a matter of urgency.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Mon Apr 09, 2012 12:54 pm    Post subject: Reply with quote

Please try the following update for SDK 10.0 - it should fix the crash but more than likely it will come up and tell you that the trial has expired.

ftp://support.red-gate.com/patches/sql_comparison_sdk/sql_comparison_sdk_10.0.0.111.zip
Back to top
View user's profile Send private message
clamk123



Joined: 01 Apr 2012
Posts: 28

PostPosted: Mon Apr 09, 2012 4:06 pm    Post subject: Reply with quote

Thanks! That fixed it completely. The licensing window pops up, so I can start my trial period.

I appreciate your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group