Options

ASP.Net Licensing

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
edited July 21, 2004 7:03AM in SQL Toolkit Previous Versions
Hi Jamie,

It's a complicated problem. Basically, we've used the licensing system
built into .net, albeit with a custom licence provider. You can read a bit
more about how the architecture is supposed to work here:
http://windowsforms.net/articles/Licensing.aspx

What I've found is that: 1. the *.lic files should be saved alongside
the referenced assemblies (SQLCompare.Engine.dll...) for licensing to be
able to find them. Sometimes this doesn't work though, and I don't know why
not. 2. If you upgrade SQL Bundle, you'll need to re-reference the Red Gate
libraries and rebuild the project. Make sure to distribute the new Red Gate
libraries with the new version of the project if you want to distribute the
upgraded Toolkit application.3. Test the resulting application on a machine
without the Red Gate SQL Bundle installed on it first to make sure the
licensing worked.

SQL Toolkit.lic is going to contain the exact same information as long
as the software is registered on the same machine, so re-activating Toolkit
and getting a new .lic file won't help you much if you already have a .lic
file on the computer. It's safe to copy this file to wherever it needs to be
to get the licensing going.

If I remember correctly, the DEBUG compilation hits the text parsing
routines that gather information from the SQL code particularly hard, so
there is probably going to be a bigger difference between debug builds in
Toolkit 3.15 and 3.16+, but the second 3.16 release did have quite a few
improvements in that area and it will get a bit better in the next release
again.

We should probably document the default options at some point when the
software becomes a bit more mature. In the meantime, you can check which
options are applied to Options.Default with a bit of code:

CheckOptions(Options.Default)...
static void CheckOptions(Options enOptions)
{

if ((enOptions & Options.IgnoreBindings) !=0) Console.WriteLine(""Ignore
Bindings" option is set.");

if ((enOptions & Options.IncludeDependencies) !=0)
Console.WriteLine(""Include Dependencies" option is set."); ...

}

If you logically AND an option with Options.Default together and they
are set, the result will not be zero.

To prevent problems in the future, you may want to explicitly state
which options you want to use by logically ORing them together with a
vertical bar: (Options enOptions=Options.IncludeDependencies |
Options.IgnoreBindings)

Regards,

Brian Donahue
Red Gate Technical Support


"Jamie Baxter" <jamie.baxter@watsonwyatt.com> wrote in message
news:Z%239rdVlTEHA.1512@server53...
> I was calling yesterday in regards to licensing problems within ASP.Net
Web
> Services.
>
> I had everything working for quite a while then I upgraded to the newest
> version yesterday and it stopped working again. It is trying to do the
> pop-up dialog through a webservice and that doesn't work. I spent almost
4
> hours yesterday trying to get this to work. I have included details of
what
> happened below - but at the end of the day it is working again - but I'm
> afraid I don't know how/why.
>
> Architecture
> I have a set of C# Class Library Project that references the RedGate
> Assemblies - let's call this BizObjects. I then have a webservices
project
> that references BizObjects. On top of that I have an ASP.Net project that
> utilizes the WebServices to access data and perform work in the
BizObjects.
>
> Licensing pre-upgrade
> Before my upgrade I had the "licenses.licx" (with both lines in the file)
in
> my BizObjects project. I also had the "SQL Toolkit.lic" file in the
> indebug folder of the BizObjects Project. Note that the "SQL
> Toolkit.lic" file was also in "C:Program FilesRed Gate SQL Bundle" - but
I
> couldn't get it to work without having it in the indebug folder.
>
> Upgrade
> So I read a post that the newest version runs faster during debug - so I
> decide to upgrade. After upgrading I start getting the licensing error
> again - stating that it is try to do a modal pop-up box. I start trying
to
> figure this out - after looking on the newsgroup and in the help. The
steps
> I took -
> - Verify the files are still there
> - Run a Console Application - it prompts me and I get the pop-up - run
> through the licensing routine and get a "SQL Toolkit.lic" file under the
> indebug of my Console Application
> - I figure - maybe the new version needs a new License file - so I copy
this
> file to my BizObjectsindebug folder - no luck
> - I copy the same file to "C:Program FilesRed Gate SQL Bundle" - no luck
> - I assume the new version is looking in a different way for this file
than
> before - so I put the new "SQL Toolkit.lic" file in my WebServices in
> directory - no luck
> - I put the license file in the relevant
> "C:windowsmicrosoft.netframeworkv1.1.4322 emporary asp.net files"
> directory - no luck - even though I knew this would be a one time effort -
> no luck - I remove it
> - So I decide to put the "licenses.licx" in my WebServices directory. It
> complains that it can't compile the file and doesn't know what the type
> library is.
> - I add a reference to the RedGate Assemblies in my WebServices project -
> and it compiles. I now run and it works! It found it - or something...
> - So I decide to start removing stuff one at a time to see what ends up
> breaking - and when I start getting prompted again. I keep removing
things
> and it keeps working - weird.
> - I am now down to the following - I have the "licenses.licx" (with both
> lines in the file) in my BizObjects project and I have the "SQL
Toolkit.lic"
> file in "C:Program FilesRed Gate SQL Bundle" - and it still works!
> - I have deleted all the RedGate Assemblies in my BizObjectsindebug and
> WebServicein directories and re-compiled - still works.
> - I removed all of the files in
> "C:windowsmicrosoft.netframeworkv1.1.4322 emporary asp.net files" -
> still works.
> - I can't seem to break it now!
>
> Questions
> - It seems to me that having the "SQL Toolkit.lic" file under the
> BizObjectsindebug was causing it to not work - is this true?
> - Does a new "SQL Toolkit.lic" file need to be generated with each
release?
> - Does my final configuration represent what it should be?
>
> Overall and other Misc Stuff
> - I LOVE your products!
> - I know licensing is important - but it has to be easy - and it needs to
be
> better documented. This includes windows apps, console apps, web apps,
and
> webservice apps.
> - Running in debug mode needs to be fixed - seriously. I am at a point
now
> that I can't run my app in debug mode because the RedGate functions take
> 500%+ longer in debug than they do when not in debug. Why is this? When
> can this be fixed?
> - Misc Rant - Options.Default - this needs to be documented and
communicated
> when changed. I understand how I can write a little application to test
> what is contained within this - but I shouldn't have to go through that
> exercise to understand it. It also appears that the options have changed
> since my last version and now includes "IncludeDependencies". This drove
me
> crazy - because I can't debug my application - and after upgrading it
starts
> behaving differently.
>
>

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    One more thing: It seems to work a lot better if you rebuild the project
    as opposed to just Building it. I think if you force Visual Studio to
    compile every single file and not just the ones marked as modified, the
    licensing works a whole lot better.

    Hopefully that'll sort things out for you.

    Regards,

    Brian Donahue
    Red Gate Technical Support

    "Jamie Baxter" <jamie.baxter@watsonwyatt.com> wrote in message
    news:Z%239rdVlTEHA.1512@server53...
    > I was calling yesterday in regards to licensing problems within ASP.Net
    Web
    > Services.
    >
    > I had everything working for quite a while then I upgraded to the newest
    > version yesterday and it stopped working again. It is trying to do the
    > pop-up dialog through a webservice and that doesn't work. I spent almost
    4
    > hours yesterday trying to get this to work. I have included details of
    what
    > happened below - but at the end of the day it is working again - but I'm
    > afraid I don't know how/why.
    >
    > Architecture
    > I have a set of C# Class Library Project that references the RedGate
    > Assemblies - let's call this BizObjects. I then have a webservices
    project
    > that references BizObjects. On top of that I have an ASP.Net project that
    > utilizes the WebServices to access data and perform work in the
    BizObjects.
    >
    > Licensing pre-upgrade
    > Before my upgrade I had the "licenses.licx" (with both lines in the file)
    in
    > my BizObjects project. I also had the "SQL Toolkit.lic" file in the
    > indebug folder of the BizObjects Project. Note that the "SQL
    > Toolkit.lic" file was also in "C:Program FilesRed Gate SQL Bundle" - but
    I
    > couldn't get it to work without having it in the indebug folder.
    >
    > Upgrade
    > So I read a post that the newest version runs faster during debug - so I
    > decide to upgrade. After upgrading I start getting the licensing error
    > again - stating that it is try to do a modal pop-up box. I start trying
    to
    > figure this out - after looking on the newsgroup and in the help. The
    steps
    > I took -
    > - Verify the files are still there
    > - Run a Console Application - it prompts me and I get the pop-up - run
    > through the licensing routine and get a "SQL Toolkit.lic" file under the
    > indebug of my Console Application
    > - I figure - maybe the new version needs a new License file - so I copy
    this
    > file to my BizObjectsindebug folder - no luck
    > - I copy the same file to "C:Program FilesRed Gate SQL Bundle" - no luck
    > - I assume the new version is looking in a different way for this file
    than
    > before - so I put the new "SQL Toolkit.lic" file in my WebServices in
    > directory - no luck
    > - I put the license file in the relevant
    > "C:windowsmicrosoft.netframeworkv1.1.4322 emporary asp.net files"
    > directory - no luck - even though I knew this would be a one time effort -
    > no luck - I remove it
    > - So I decide to put the "licenses.licx" in my WebServices directory. It
    > complains that it can't compile the file and doesn't know what the type
    > library is.
    > - I add a reference to the RedGate Assemblies in my WebServices project -
    > and it compiles. I now run and it works! It found it - or something...
    > - So I decide to start removing stuff one at a time to see what ends up
    > breaking - and when I start getting prompted again. I keep removing
    things
    > and it keeps working - weird.
    > - I am now down to the following - I have the "licenses.licx" (with both
    > lines in the file) in my BizObjects project and I have the "SQL
    Toolkit.lic"
    > file in "C:Program FilesRed Gate SQL Bundle" - and it still works!
    > - I have deleted all the RedGate Assemblies in my BizObjectsindebug and
    > WebServicein directories and re-compiled - still works.
    > - I removed all of the files in
    > "C:windowsmicrosoft.netframeworkv1.1.4322 emporary asp.net files" -
    > still works.
    > - I can't seem to break it now!
    >
    > Questions
    > - It seems to me that having the "SQL Toolkit.lic" file under the
    > BizObjectsindebug was causing it to not work - is this true?
    > - Does a new "SQL Toolkit.lic" file need to be generated with each
    release?
    > - Does my final configuration represent what it should be?
    >
    > Overall and other Misc Stuff
    > - I LOVE your products!
    > - I know licensing is important - but it has to be easy - and it needs to
    be
    > better documented. This includes windows apps, console apps, web apps,
    and
    > webservice apps.
    > - Running in debug mode needs to be fixed - seriously. I am at a point
    now
    > that I can't run my app in debug mode because the RedGate functions take
    > 500%+ longer in debug than they do when not in debug. Why is this? When
    > can this be fixed?
    > - Misc Rant - Options.Default - this needs to be documented and
    communicated
    > when changed. I understand how I can write a little application to test
    > what is contained within this - but I shouldn't have to go through that
    > exercise to understand it. It also appears that the options have changed
    > since my last version and now includes "IncludeDependencies". This drove
    me
    > crazy - because I can't debug my application - and after upgrading it
    starts
    > behaving differently.
    >
    >
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    One small correction:

    When you specify the options, you BITWISE OR them together, not a
    LOGICAL OR. Not the same thing! (At least in C# it isn't: it's a '|' rather
    than a '||')

    Regards,

    Brian Donahue
    Red Gate Technical Support

    "Jamie Baxter" <jamie.baxter@watsonwyatt.com> wrote in message
    news:Z%239rdVlTEHA.1512@server53...
    > I was calling yesterday in regards to licensing problems within ASP.Net
    Web
    > Services.
    >
    > I had everything working for quite a while then I upgraded to the newest
    > version yesterday and it stopped working again. It is trying to do the
    > pop-up dialog through a webservice and that doesn't work. I spent almost
    4
    > hours yesterday trying to get this to work. I have included details of
    what
    > happened below - but at the end of the day it is working again - but I'm
    > afraid I don't know how/why.
    >
    > Architecture
    > I have a set of C# Class Library Project that references the RedGate
    > Assemblies - let's call this BizObjects. I then have a webservices
    project
    > that references BizObjects. On top of that I have an ASP.Net project that
    > utilizes the WebServices to access data and perform work in the
    BizObjects.
    >
    > Licensing pre-upgrade
    > Before my upgrade I had the "licenses.licx" (with both lines in the file)
    in
    > my BizObjects project. I also had the "SQL Toolkit.lic" file in the
    > indebug folder of the BizObjects Project. Note that the "SQL
    > Toolkit.lic" file was also in "C:Program FilesRed Gate SQL Bundle" - but
    I
    > couldn't get it to work without having it in the indebug folder.
    >
    > Upgrade
    > So I read a post that the newest version runs faster during debug - so I
    > decide to upgrade. After upgrading I start getting the licensing error
    > again - stating that it is try to do a modal pop-up box. I start trying
    to
    > figure this out - after looking on the newsgroup and in the help. The
    steps
    > I took -
    > - Verify the files are still there
    > - Run a Console Application - it prompts me and I get the pop-up - run
    > through the licensing routine and get a "SQL Toolkit.lic" file under the
    > indebug of my Console Application
    > - I figure - maybe the new version needs a new License file - so I copy
    this
    > file to my BizObjectsindebug folder - no luck
    > - I copy the same file to "C:Program FilesRed Gate SQL Bundle" - no luck
    > - I assume the new version is looking in a different way for this file
    than
    > before - so I put the new "SQL Toolkit.lic" file in my WebServices in
    > directory - no luck
    > - I put the license file in the relevant
    > "C:windowsmicrosoft.netframeworkv1.1.4322 emporary asp.net files"
    > directory - no luck - even though I knew this would be a one time effort -
    > no luck - I remove it
    > - So I decide to put the "licenses.licx" in my WebServices directory. It
    > complains that it can't compile the file and doesn't know what the type
    > library is.
    > - I add a reference to the RedGate Assemblies in my WebServices project -
    > and it compiles. I now run and it works! It found it - or something...
    > - So I decide to start removing stuff one at a time to see what ends up
    > breaking - and when I start getting prompted again. I keep removing
    things
    > and it keeps working - weird.
    > - I am now down to the following - I have the "licenses.licx" (with both
    > lines in the file) in my BizObjects project and I have the "SQL
    Toolkit.lic"
    > file in "C:Program FilesRed Gate SQL Bundle" - and it still works!
    > - I have deleted all the RedGate Assemblies in my BizObjectsindebug and
    > WebServicein directories and re-compiled - still works.
    > - I removed all of the files in
    > "C:windowsmicrosoft.netframeworkv1.1.4322 emporary asp.net files" -
    > still works.
    > - I can't seem to break it now!
    >
    > Questions
    > - It seems to me that having the "SQL Toolkit.lic" file under the
    > BizObjectsindebug was causing it to not work - is this true?
    > - Does a new "SQL Toolkit.lic" file need to be generated with each
    release?
    > - Does my final configuration represent what it should be?
    >
    > Overall and other Misc Stuff
    > - I LOVE your products!
    > - I know licensing is important - but it has to be easy - and it needs to
    be
    > better documented. This includes windows apps, console apps, web apps,
    and
    > webservice apps.
    > - Running in debug mode needs to be fixed - seriously. I am at a point
    now
    > that I can't run my app in debug mode because the RedGate functions take
    > 500%+ longer in debug than they do when not in debug. Why is this? When
    > can this be fixed?
    > - Misc Rant - Options.Default - this needs to be documented and
    communicated
    > when changed. I understand how I can write a little application to test
    > what is contained within this - but I shouldn't have to go through that
    > exercise to understand it. It also appears that the options have changed
    > since my last version and now includes "IncludeDependencies". This drove
    me
    > crazy - because I can't debug my application - and after upgrading it
    starts
    > behaving differently.
    >
    >
This discussion has been closed.