Unable to produce licensing

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
JORGEMAL
Posts: 171
Joined: Thu 03 Jul 2008 23:55

Unable to produce licensing

Post by JORGEMAL » Tue 24 Apr 2018 18:01

Recently, I installed VS2017 and developed my first ASP.NET MVC (just MVC not Core) project and published it to a web server for testing. I do not have the DotConnect Wizard in "Tools/PostgreSQL/License Information" available in VS2017 (only in VS2015 that I also have). I have read instructions here (https://www.devart.com/dotconnect/postg ... nsing.html) but I have not been able to fix my issue. I created the "licenses.licx" file and added the line "Devart.Data.PostgreSql.PgSqlConnection, Devart.Data.PostgreSql" but it seems nothing happens when compiling my MVC project. I also right-click the "licenses.licx" file in Solution Explorer but I do not see the "Build Runtime Licenses" options.I checked the file properties and it is an "embedded resource".

I would like to get the DotConnect Wizard available in VS2017. How can I achieve that?

Regards.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Unable to produce licensing

Post by Pinturiccio » Wed 25 Apr 2018 15:46

Please tell us your dotConnect for PostgreSQL version. Please also tell us whether you installed Visual Studio 2017 when dotConnect for PostgreSQL already had been installed, and didn't reistall dotConnect for PostgreSQL since then.

JORGEMAL
Posts: 171
Joined: Thu 03 Jul 2008 23:55

Re: Unable to produce licensing

Post by JORGEMAL » Wed 25 Apr 2018 16:33

dotConnect for PostgreSQL version: 7.4.616.5 although we plan to upgrade when once we update PostgreSQL to version 10. But for now it is fine.
dotConnect for PostgreSQL was already installed when Visual Studio 2017 was installed. No re-installation has been done since the original installation.

Regards.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Unable to produce licensing

Post by Pinturiccio » Thu 26 Apr 2018 15:46

The integration to Visual Studio is performed during dotConnect for PostgreSQL installation. If you installed Visual Studio 2017 after this, our provider won't be integrated into it. You need to reinstall dotConnect for PostgreSQL to have it integrated into a new Visual Studio.

Please note, that Visual Studio 2017 is supported starting from dotConnect for PostgreSQL 7.8.862. For more information, please refer to https://www.devart.com/dotconnect/postg ... story.html. Thus you will not have dotConnect for PostgreSQL Licence wizard with dotConnect for PostgreSQL 7.4.616 even if you reinstall the provider.

With Visual Studio 2017, you need to use dotConnect for PostgreSQL 7.8.862 or higher. However, you can use Visual Studio 2017 even with dotConnect for PostgreSQL of a version older than 7.8.862. In this case you have to compile license resources manually.

The license resource can be compiled in the following way:
1) Create a text file named licenses.licx and enter the following text inside the licenses.licx file:
Devart.Data.PostgreSql.PgSqlConnection, Devart.Data.PostgreSql

2) Generate the license resource file using the following command line:
"%Compiler Path%\lc.exe /target:MyApplication.exe /complist:licenses.licx /i:"%Assembly Path%\Devart.Data.PostgreSql.dll"
Where:

- %Compiler Path% is the path to the appropriate lc.exe file (for example, C:\Program Files\Microsoft.NET\SDK\v2.0\Bin);
- MyApplication.exe is the name of your target executable file. If you want to compile a license resource for a class library project, specify MyApplication.dll instead of MyApplication.exe, where MyApplication.dll is the name of the class library.
- licenses.licx is your licenses.licx file. Place licenses.config file in the same folder as the licenses.licx file for a class library project;
- %Assembly Path% is the Devart.Data.PostgreSql.dll assembly location.

3) The License compiler will generate the 'MyApplication.exe.licenses' ('MyApplication.dll.licenses' for class library project) resource file;

4) Add this file to your project as an embedded resource.

For more information, please refer to https://www.devart.com/dotconnect/postg ... ml#compile

JORGEMAL
Posts: 171
Joined: Thu 03 Jul 2008 23:55

Re: Unable to produce licensing

Post by JORGEMAL » Sat 28 Apr 2018 21:36

I decided to upgrade to the latest version of dotConnect for PostgreSQL (7.10.1115). When I run the "Tools > PostgreSQL > License information..." option I am asked to "specify which executables are allowed to use the class library". What should I add here? My project is a regular MVC application, not a MVC Core.

Thank you.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Unable to produce licensing

Post by Pinturiccio » Wed 02 May 2018 11:13

The result file of an MVC project is a dll assembly. Two files are used for licensing class library projects: licenses.licx and licenses.config. licenses.config file specifies the names of executables that can use this class library. For a web class library, the licenses.config is not necessary; w3wp.exe can use this class library without the licenses.config file. For more information, please refer to https://www.devart.com/dotconnect/postg ... g.html#lib

The described step of License Wizard asks for executables to create the licenses.config file, which is not mandatory in your case. Thus, you can just click Next and do not specify anything on this step.

Post Reply