Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ailed to merge configuration files: System.Data.DuplicateNameException: The name 'configuration' is invalid #242

Closed
lwiechec opened this issue Dec 17, 2018 · 3 comments

Comments

@lwiechec
Copy link

Hi, I just started using ILRepack. I try to create a single EXE for my application which is a quite thin layer on top of NUnit 2 GUI runner.

At the end of repacking, I can see this:

VERBOSE: Processing XAML resource paths ...
INFO: Writing output assembly to disk
ERROR: Failed to merge configuration files: System.Data.DuplicateNameException: The name 'configuration' is invalid. A DataTable cannot have the same name of the DataSet.
   at System.Data.DataTableCollection.BaseAdd(DataTable table)
   at System.Data.DataTableCollection.Add(DataTable table)
   at System.Data.Merger.MergeSchema(DataTable table)
   at System.Data.Merger.MergeTableData(DataTable src)
   at System.Data.Merger.MergeDataSet(DataSet source)
   at System.Data.DataSet.Merge(DataSet dataSet, Boolean preserveChanges, MissingSchemaAction missingSchemaAction)
   at System.Data.DataSet.Merge(DataSet dataSet)
   at ILRepacking.ConfigMerger.Process(ILRepack repack)

In the end I do get my exe, but running it throws an error; application also has different version and file descriptor - it lists now one of the dependencies.

I guess the - entry point is incorrect... can you help?

@dfev77
Copy link

dfev77 commented Jun 5, 2019

This would highly depend on your app.config files.
Check if you can purge some empty/not used nodes in the config files

@HebaruSan
Copy link

HebaruSan commented Nov 23, 2019

We're seeing the same error message:

ERROR: Failed to merge configuration files: System.Data.DuplicateNameException: The name 'configuration' is invalid. A DataTable cannot have the same name of the DataSet.
  at System.Data.DataTableCollection.BaseAdd (System.Data.DataTable table) [0x00088] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at System.Data.DataTableCollection.Add (System.Data.DataTable table) [0x0002f] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at System.Data.Merger.MergeSchema (System.Data.DataTable table) [0x0008e] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at System.Data.Merger.MergeTableData (System.Data.DataTable src) [0x00000] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at System.Data.Merger.MergeDataSet (System.Data.DataSet source) [0x000e1] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at System.Data.DataSet.Merge (System.Data.DataSet dataSet, System.Boolean preserveChanges, System.Data.MissingSchemaAction missingSchemaAction) [0x00040] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at System.Data.DataSet.Merge (System.Data.DataSet dataSet) [0x00022] in <f3b036cdf45644d58864dfe09bb31bd4>:0 
  at ILRepacking.ConfigMerger.Process (ILRepacking.ILRepack repack) [0x000a6] in <853c03db7f88463ebe1682698b9aa644>:0 

Our app.config files:

<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
    </startup>
  <runtime>
    <enforceFIPSPolicy enabled="false"/>
    <loadFromRemoteSources enabled="true"/>
  </runtime>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
  <runtime>
    <enforceFIPSPolicy enabled="false"/>
    <loadFromRemoteSources enabled="true"/>
  </runtime>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
</configuration>

What they look like at time of merge, after the projects are built:

  • CmdLine/Debug/bin/CKAN-ConsoleUI.exe.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections></configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <runtime>
    <enforceFIPSPolicy enabled="false" />
    <loadFromRemoteSources enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
  • CmdLine/Debug/bin/CKAN-GUI.exe.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <runtime>
    <enforceFIPSPolicy enabled="false" />
    <loadFromRemoteSources enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
  • CmdLine/Debug/bin/CmdLine.exe.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <runtime>
    <enforceFIPSPolicy enabled="false" />
    <loadFromRemoteSources enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

I don't pretend to know much about app.config files; I'm just trying to investigate this error. Any suggestions?

@KirillOsenkov
Copy link
Collaborator

This is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants