Gurobi License not found C# ASP.NET Web Application

365 views
Skip to first unread message

Toni

unread,
Jan 3, 2012, 4:11:54 AM1/3/12
to Gurobi Optimization, lars.b...@gmail.com
Hello,

I am trying to build an ASP.NET web application using the Gurobi
Solver 4.6.2. I have requested an academic license and installed it at
my home directory, i.e. "C:\Users\Toni" under Windows 7 x64.

When I try to use the solver I get a "GRBException: License not
found".

The ASP.NET web application's worker process (app pool) is running
under my local administrator account "Toni". I have used the same
account to retrieve the license.

I have run grbvalidate to ensure that the gurobi.validate file has
been created in the temp folder.

Setting the environment variable GRB_LICENSE_FILE to C:\Users\Toni
\gurobi.lic does not work either.

Are there any tricks for academic licenses in conjunction with
ASP.NET?

Thank you!

Toni

Greg Glockner

unread,
Jan 3, 2012, 8:34:55 AM1/3/12
to gur...@googlegroups.com, lars.b...@gmail.com
Most likely, the ASP.NET application is running under another user account, such as described in:

http://support.microsoft.com/kb/555299

If this is the case, you will need to obtain another free academic license for the ASP.NET Machine Account.

Toni Thenhausen

unread,
Jan 3, 2012, 8:41:46 AM1/3/12
to gur...@googlegroups.com, dsp...@orconomy.de
Thanks for your reply, Greg. I have configured IIS to run under the same
user account, ie. "Toni", which I have used to obtain the license.

I think it is impossible to obtain an academic license for the IIS APPPOOL
or the NETWORKSERVICE Account, since I cannot run grbgetkey under that user
account.

-----Ursprüngliche Nachricht-----
Von: gur...@googlegroups.com [mailto:gur...@googlegroups.com] Im Auftrag von
Greg Glockner
Gesendet: Dienstag, 3. Januar 2012 14:35
An: gur...@googlegroups.com
Cc: lars.b...@gmail.com
Betreff: Re: [Gurobi] Gurobi License not found C# ASP.NET Web Application

Greg Glockner

unread,
Jan 3, 2012, 8:53:00 AM1/3/12
to gur...@googlegroups.com
Next thing to try is to determine why it isn't able to access the Gurobi license key file gurobi.lic. Other default locations are c:\gurobi46; you should also check that the GRB_LICENSE_FILE is set as a system environment variable rather than a user environment variable.

This is almost certainly an issue with the user configuration for the ASP.NET user; you'll have to diagnose it accordingly.

Toni

unread,
Jan 3, 2012, 8:58:34 AM1/3/12
to Gurobi Optimization
Thanks, I have tried both, but unfortunatly with no success:

I have set GRB_LICENSE_FILE to C:\gurobi46\gurobi.lic and copied my
license file over there.

Since I have configured IIS to use my local admin account Toni, there
should not be any security or ACL issues to access this file.

The strange thing is that I can execute the Gurobi shell (without any
licensing issues) using gurobi.bat.

Greg Glockner

unread,
Jan 3, 2012, 9:00:28 AM1/3/12
to gur...@googlegroups.com
> The strange thing is that I can execute the Gurobi shell (without any
> licensing issues) using gurobi.bat.

Can you do that through your ASP.NET application?

Toni

unread,
Jan 3, 2012, 9:15:31 AM1/3/12
to Gurobi Optimization
Unfortnuatly a call to Process.Start("gurobi.bat") does not show a
command prompt window, which is expected for calls from ASP.NET
applications. So I cannot validate the output of the gurobi.bat file.

There is no possibility to call a function of the Gurobi46.NET.dll to
troubleshoot the licensing issues or any log file which I could
activate?

Greg Glockner

unread,
Jan 3, 2012, 10:43:40 AM1/3/12
to gur...@googlegroups.com
One of the developers suggested that you should try to print the value returned by GetUserName() in your program. This will indicate what user name is used by the ASP.NET application. If it is a username without an associated login, you will not be able to use a free academic license for this application.

Toni Thenhausen

unread,
Jan 3, 2012, 11:00:50 AM1/3/12
to gur...@googlegroups.com, dsp...@orconomy.de
A call to the Environement.UserName Property correctly returned "Toni". A
call to System.Security.Principal.WindowsIdentity.GetCurrent().Name returned
"AIR\Toni" whereas Air is my machine name. So this seems to be correct. I
have tried it on another machine of a friend with the same results.

The following license file is located in the C:\gurobi46 directory. Note
that I have replaced the key with **** in this post.

# License ID 16870
# Gurobi license for University Paderborn
ORGANIZATION=University Paderborn
TYPE=ACADEMIC
HOSTNAME=AIR
HOSTID=30ccd220
USERNAME=toni
EXPIRATION=2012-06-23
VERSION=4
KEY=****

Thank you for your help.

-----Ursprüngliche Nachricht-----
Von: gur...@googlegroups.com [mailto:gur...@googlegroups.com] Im Auftrag von
Greg Glockner

Gesendet: Dienstag, 3. Januar 2012 16:44
An: gur...@googlegroups.com
Betreff: Re: [Gurobi] Re: Gurobi License not found C# ASP.NET Web
Application

One of the developers suggested that you should try to print the value

Greg Glockner

unread,
Jan 3, 2012, 9:19:23 PM1/3/12
to gur...@googlegroups.com
> The following license file is located in the C:\gurobi46 directory.

Can you confirm which version of the DLL you are using? I'm wondering if you have an older version of the Gurobi DLL and/or the Gurobi .NET libraries, which are expecting the license key file in another location.

Toni Thenhausen

unread,
Jan 4, 2012, 3:31:52 AM1/4/12
to gur...@googlegroups.com
I have verified through the file properties window that the version is the
same, i.e. 4.6.1 (win 64), for both the gurobi46.dll and the
Gurobi46.NET.dll.

I have tried to download and use the 32-Bit Version of Gurobi 4.6.1. I have
swapped the Gurobi46.NET.dll in my Visual Studio project, redownloaded the
license just in case using grbgetkey and changed the IIS application to run
in 32 Bit mode. The same license exception is being thrown.

-----Ursprüngliche Nachricht-----
Von: gur...@googlegroups.com [mailto:gur...@googlegroups.com] Im Auftrag von
Greg Glockner

Gesendet: Mittwoch, 4. Januar 2012 03:19
An: gur...@googlegroups.com
Betreff: Re: [Gurobi] Gurobi License not found C# ASP.NET Web Application

Toni Thenhausen

unread,
Jan 4, 2012, 3:56:31 AM1/4/12
to gur...@googlegroups.com
I have just tried to downgrade to Gurobi 4.5.2 Win 64, obtained the license
key again placed in the C:\gurobi45 folder, changed the assembly binding to
use Gurobi45.NET.dll. But the same license issue occurs:
Gurobi.GRBException: License not found

-----Ursprüngliche Nachricht-----
Von: gur...@googlegroups.com [mailto:gur...@googlegroups.com] Im Auftrag von
Greg Glockner

Gesendet: Mittwoch, 4. Januar 2012 03:19

An: gur...@googlegroups.com
Betreff: Re: [Gurobi] Gurobi License not found C# ASP.NET Web Application

Ed Rothberg

unread,
Jan 5, 2012, 3:10:41 PM1/5/12
to Gurobi Optimization

We print a detailed message that indicates exactly why the license
check failed, but it goes to stdout. I did a bit of research, and it
appears that you can view stdout messages in the ASP.NET
Console window, but only if you launch ASP.NET in debug mode.

Knowing what's in that message would definitely help to narrow this
down.

Ed

Reply all
Reply to author
Forward
0 new messages