Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →FAQ: Licensing and Deploying Builds of Finished Applications
Follow these instructions to test, build, and distribute apps using the CData single developer, royalty-free license.
Date Entered: 9/15/2014 Last Updated: 9/15/2014
License and distribute the CData ADO.NET provider as a run-time component in your application.
- How do I License and Distribute the Provider for a Windows Application?
- How do I License and Distribute the Provider for a .NET Core/.NET Standard Application?
- How Do I License and Distribute the Provider for a Web App?
- How do I License and Distribute the Provider for an Entity Framework Application?
- How Do I Build App_Licenses.dll?
- How Do I Transfer a License?
- Why am I Receiving This Error?
How do I License and Distribute the Provider for a Windows Application using .NET 3.5 or 4.0?
CData ADO.NET providers use the .NET Licensing Scheme. Follow the steps below to add the license to your project as an embedded resource.
- In Visual Studio, include the license file (Licenses.licx) in the project. Add Licenses.licx by clicking Add Existing Item on the Project menu. You can find Licenses.licx in the installation folder of the CData ADO.NET provider.
- When you deploy your application, include the CData assemblies in the same directory as the executable.
How do I License and Distribute the Provider for a .NET Core/.NET Standard Application?
A license must be activated before the .NET Standard Provider can be used. To activate a license use install-license, a .NET Core application included with the Provider.
If the Provider was installed from a NuGet package, this application is present in the tools folder in the package installation directory. Typically the package can be found here on Windows: %USERPROFILE%\.nuget\packages\cdata.datasource
If the library was installed as part of the .NET Edition, the application is present in the lib/netstandard2.0 folders of the installation directory.
To use the install-license application run the command:
dotnet ./install-license.dll key
Where key is your product key. This will install a license on the particular system.
DeploymentDeployment in .NET Standard/.NET Core requires a RuntimeKey (RTK) to be specified in the connection string of a CData provider. Email [email protected] to obtain an RTK.
How Do I License and Distribute the Provider for a Web App?
Web Apps can be licensed by compiling App_Licenses.dll and deploying this assembly in the same folder as the executable and the CData assembly.
- To license your application, first add the Licenses.licx file to your project. Licenses.licx is located in the installation folder of the CData ADO.NET provider.
- Right-click on Licenses.licx in the Solution Explorer, and select Build Runtime Licenses from the menu. This will create App_Licenses.dll.
- To distribute your application, copy App_Licenses.dll to your project. You will also need to copy the CData assembly and App_Licenses.dll into the same folder as your executable; for example, the Bin folder for Web apps.
How do I License and Distribute the Provider for My Entity Framework Application?
Follow the steps below to license an application that uses the Entity Framework. For example, MVC.
-
Copy the required CData assemblies into the same folder as the executable. The assemblies for CData ADO.NET providers are located in the lib subfolder of the installation directory. For .NET 4.0, ensure that you use the DLLs, located in the 4.0 subfolder in the lib directory.
All CData ADO.NET providers require the same assemblies. QuickBooks is used as an example below:
- System.Data.CData.QuickBooks.dll
- System.Data.CData.QuickBooks.Entities.dll
Use System.Data.CData.Entities.EF6 if you are using Entity Framework 6.
-
Add the provider key from Machine.config to the App.config or Web.config of your application or site. The Machine.config is located in the Config folder in the .NET Framework directory for your version of the .NET Framework. .NET 4.0 uses C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and .NET 2.0 uses C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG. The App.config or Web.config should resemble the entry using QuickBooks below:
<system.data> <DbProviderFactories> .... <add name="CData ADO.NET Provider for QuickBooks".../> .... </DbProviderFactories> </system.data>
- To license your product, add Licenses.licx, located in the installation folder of the CData ADO.NET provider, to your build. Right-click Licenses.licx, and select Build Runtime Licenses. This generates App_Licenses.dll. For Windows Forms applications, App_Licenses.dll is created when you build the executable.
To deploy a Windows Forms application, App_Licenses.dll and the CData assemblies must both be in the same folder as the executable.
To deploy a Web app, the CData assembly and App_Licenses.dll must be located in the bin folder. Applications that use the Entity Framework require both the CData and CData Entities assemblies. Ensure that you copy the .NET 4.0 assemblies, located in the 4.0 subfolder of the lib folder where the provider is installed.
How Do I Build App_Licenses.dll?
In most scenarios, you can build App_Licenses.dll by following the procedures above — add Licenses.licx to your project and right-click the license to select Build Runtime Licenses.
If the Build Runtime Licenses option does not work for you, you can build App_Licenses.dll in a separate project:
- Create a new project
- Add licenses.licx as an embedded resource to the root node of the project
- Add a reference to the CData assemblies, for example System.Data.CData.QuickBooks.dll and System.Data.CData.QuickBooks.Entities.dll
NOTE: You must reference the same .NET version of the CData assembly as you are distributing with your web app.
Building the project creates App_Licenses.dll. This assembly must be distributed in the same folder as your executable and the CData assemblies.
How Do I Transfer a License?
- Complete the transfer process here:
https://www.cdata.com/lic/transfer/ - Fully uninstall the provider from your machine.
- Install the provider on the machine you wish to transfer the license to. You will need to get the Node Id for both machines. Download the Node Id tool here:
https://www.cdata.com/lic/nodeid.exe
Why am I Receiving This Error?
-
"Could not load file or assembly 'System.Data.CData.QuickBooks, Version=20.0.0.0, Culture=neutral, PublicKeyToken=f57f3fbecba6b076' or one of its dependencies. The system cannot find the file specified."
This error means that the CData assembly, such as System.Data.CData.QuickBooks.dll, has not been added to the project as a reference. You can find the assembly in the Lib folder where you installed the provider.
-
"Could not load file or assembly 'System.Data.CData.SharePoint, Version=20.0.7450.0, Culture=neutral, PublicKeyToken=f57f3fbecba6b076' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference."
This error notifies you that the Machine.config entry does not match the assembly that you are using. To resolve this error, you need to copy several settings in the Machine.config file for the version of .NET Framework that you are using into your Web.config or App.config file. Please see the relevant procedure for your application type.
We appreciate your feedback. If you have any questions, comments, or suggestions about this entry, please contact our support team at [email protected].