Description

This page will explain how to solve issues such as when the Run Dynamic Link Manager is failing with the error "System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for system.data: Column 'InvariantName' is constrained to be unique" occurs.


The full error that appears in the Dynamic link rules log file message is :

C:\Program Files\CAST\8.2>dynamiclinks.cli.exe executerules --profile="<YOUR_CONNECTION_PROFILE>" --rulefile="C:\CAST\MY_DLM_RULE\MyApplication.dlm.xml" --log="C:\CAST\Logs\DLM\MyApplication_DLM.xml.log"
2017-04-19 07:45:20,567 [1] INFO  DynamicLinks main - DynamicLinks.CLI.exe "exec
uterules" "--profile=ccpm_mngt" "--rulefile=C:\CAST\MY_DLM_RULE\MyApplication.dlm.xml" "--log=C:\CAST\Logs\DLM\MyApplication_DLM.xml.log"
2017-04-19 07:45:20,607 [1] INFO  DynamicLinks main - Loading C:\CAST\MY_DLM_RULE\MyApplication.dlm.xml
2017-04-19 07:45:20,982 [1] INFO  DynamicLinks main - Loaded successfully 5 rules
Testing validity
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Configuration.ConfigurationErrorsException: A
n error occurred creating the configuration section handler for system.data: Column 'InvariantName' is constrained to be unique.  Value 'Npgsql' is already pres
ent. (S:\Program Files\CAST\8.2\DynamicLinks.CLI.exe.Config line 9) ---> System.Data.ConstraintException: Column 'InvariantName' is constrained to be unique.  Value 'Npgsql' is already present.
   at System.Data.UniqueConstraint.CheckConstraint(DataRow row, DataRowAction action)
   at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
   at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException)
   at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos,Boolean fireEvent)
   at System.Data.DataRowCollection.Add(DataRow row)
   ...
Connection profile: MyCSS2Server/my_application_mngt (Invalid)
Testing validity
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotSupportedException: Unable to determine the provider name for connection of type 'Npgsql.NpgsqlConnection'.
   at System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.Get
ProviderInvariantName(DbConnection connection)
....
Unhandled Exception: DynamicLinks.DlmException: No connection profile called <YOUR_CONNECTION_PROFILE>
   at DynamicLinks.CLI.CommandLineExecuter.DynamicLinks.CLI.IDlmOptionVisitor.Visit(ExecuteRulesOption option)
   at DynamicLinks.CLI.CommandLineExecuter.Execute(String[] args)
   at DynamicLinks.CLI.Program.Main(String[] args)
Observed in CAST AIP
Release
Yes/No
8.3.x(tick)
8.2.x (tick) 
8.1.x (tick) 
8.0.x  (tick) 
7.3.x (tick)
Observed on RDBMS
RDBMS
Yes/No
Oracle Server (tick)
Microsoft SQL Server (tick)
CSS3(tick)
CSS2 (tick)
Step by Step Scenario
  1. Create the DLM Filter Rule as described in the page CMS - Dynamic Link Manager filter rules
  2. Run the Analysis or Execute the DynamicLinks rule by using the DynamicLinks.CLI.exe as described in the DLM documentation : CMS - CAST Management Studio - How To > CMS - Dynamic Link Manager filter rules | Command line section
  3. The DLM is failing.
  4. Open the DLM log file that is located in the Dynamic Link Log Path.
  5. The above error is displayed.
Action Plan

This issue is due to the fact that tools that are using .NET framework is not compatible with Entity framework (that is used by the Dynamic link rules) which is not installed on the machine.

For Instance the tool Powerquery is making the DLM fail because it adds incompatible entries in the machine.config file that is in the .NET framework folder. The entry added is NPGSQL entry.That is some external tools are changing the config file.

If this is the case, the solution is to 

  1. Replace the file DynamicLinks.CLI.exe.config that is in your CAST Installation Folder by the DynamicLinks.CLI.exe.config. It is a configuration file that is used only for the DLM Rules. The modification prevents the DLM rules to read the machine.config file that is in the .NET framework installation.
Notes/comments
 Ticket # 9390
Related Pages