Excel-DNA / ExcelDna

Excel-DNA - Free and easy .NET for Excel. This repository contains the core Excel-DNA library.
https://excel-dna.net
zlib License
1.29k stars 274 forks source link

.dna could not be loaded exception demo #200

Open assenbog opened 6 years ago

assenbog commented 6 years ago

ErrorDemo.zip

augustoproiete commented 6 years ago

Context: .dna file could not be loaded exception

---------- Forwarded message ---------- From: AssenB Date: Wed, May 23, 2018 at 10:49 AM Subject: [ExcelDna] .dna file could not be loaded exception To: Excel-DNA

Hi,

After changing computers and upgrading to the latest (0.34.6) the following command, which used to work before, now throws an exception:

ExcelDnaPack.exe GRDBExcelAddIn.dna /Y

The exception is

.dna file could not be loaded. Possibly malformed xml content? Aborting.

I'm attaching the DNA file in question

Any help in resolving this would be greatly appreciated

Thank you

Assen


Attachment:

<DnaLibrary Name="GRDB Excel Add-In" RuntimeVersion="v4.0">
  <ExternalLibrary Path="GRDBExcelAddIn.dll" LoadFromBytes="true" Pack="true" />

  <!-- ExcelDna.Utilities are required by GRDB Export -->
  <Reference Path="ExcelDna.Utilities.dll" Pack="true" />

  <!-- Dal2 -->
  <Reference Path="GAM.Reporting.Dal2.Statistics.dll" Pack="true" />
  <Reference Path="GAM.Reporting.Dal2.RepositoryInterface.dll" Pack="true" />
  <Reference Path="GAM.Reporting.Dal2.RepositoryFIND.dll" Pack="true" />
  <Reference Path="GAM.Reporting.Dal2.RepositoryCDB.dll" Pack="true" />
  <Reference Path="GAM.Reporting.Dal2.Framework.dll" Pack="true" />
  <Reference Path="GAM.MktTech.Data.ADO.dll" Pack="true" />

  <!-- Dal1 -->
  <Reference Path="Gam.Reporting.DalFramework.dll" Pack="true" />
  <Reference Path="Gam.Reporting.Dal.Contracts.dll" Pack="true" />
  <Reference Path="Gam.Reporting.Dal.Business.dll" Pack="true" />
  <Reference Path="Gam.Reporting.DalDataAccess.dll" Pack="true" />
  <Reference Path="Gam.Reporting.DalCdb.Business.dll" Pack="true" />
  <Reference Path="GAM.DataResults.dll" Pack="true" />
  <!-- This file cannot be packed..
   Has to be in folder - placed by installation -->
  <!-- <Reference Path="StoredProcedures.config" Pack="true" /> -->

  <!-- GRETIL -->
  <Reference Path="GRETIL.Logging.dll" Pack="true" />
  <Reference Path="GRETIL.Common.dll" Pack="true" />
  <Reference Path="GRETIL.Configuration.dll" Pack="true" />
  <Reference Path="NLog.dll" Pack="true" />

  <!-- DevExpress -->
  <Reference Path="DevExpress.Data.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.Office.v15.1.Core.dll" Pack="true" />
  <Reference Path="DevExpress.Printing.v15.1.Core.dll" Pack="true" />
  <Reference Path="DevExpress.RichEdit.v15.1.Core.dll" Pack="true" />
  <Reference Path="DevExpress.Sparkline.v15.1.Core.dll" Pack="true" />
  <Reference Path="DevExpress.Utils.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.XtraBars.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.XtraEditors.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.XtraGrid.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.XtraLayout.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.XtraPrinting.v15.1.dll" Pack="true" />
  <Reference Path="DevExpress.XtraTreeList.v15.1.dll" Pack="true" />

  <!-- Entity Framework -->
  <Reference Path="EntityFramework.dll" Pack="true" />
  <Reference Path="EntityFramework.SqlServer.dll" Pack="true" />

  <!-- AGCSE -->
  <Reference Path="AGcseDomain.dll" Pack="true" />
  <Reference Path="AGcseWcf.dll" Pack="true" />

  <!-- GrdbExport -->
  <Reference Path="GrdbExport.dll" Pack="true" />

  <!-- PostSharp -->
  <Reference Path="PostSharp.dll" Pack="true" />
  <Reference Path="PostSharp.Patterns.Diagnostics.dll" Pack="true" />

  <!--- these for inproc version of AGCSE -->
  <Reference Path="AGcseWcfService.dll" Pack="true" />

  <!--- Required by CalcEngine: BUT these cannot pack as mixed mode assemblies - 
   Have to be in folder placed by installation-->
  <!---
  <Reference Path="GAMCalcEngine.dll" Pack="true"  />
  <Reference Path="msvcp100.dll" Pack="true" />
  <Reference Path="msvcr100.dll" Pack="true" />
  -->

  <!-- NB - get packing error for these Microsoft ones ?? -->

  <!-- General used for forms -->
  <!-- <Reference Path="System.Windows.Forms" Pack="true" /> -->
  <!-- General required so we can use dynamic keyword-->
  <!-- <Reference Path="Microsoft.CSharp" Pack="true" /> -->

  <!-- 
       The RuntimeVersion attribute above allows two settings:
       * RuntimeVersion="v2.0" - for .NET 2.0, 3.0 and 3.5
       * RuntimeVersion="v4.0" - for .NET 4 and 4.5

       Additional referenced assemblies can be specified by adding 'Reference' tags. 
       These libraries will not be examined and registered with Excel as add-in libraries, 
       but will be packed into the -packed.xll file and loaded at runtime as needed.
       For example:

       <Reference Path="Another.Library.dll" Pack="true" />

       Excel-DNA also allows the xml for ribbon UI extensions to be specified in the .dna file.
       See the main Excel-DNA site at http://excel-dna.net for downloads of the full distribution.
  -->

  <!--   Ribbon -->

  <CustomUI>
    <!-- Inside here is the exact RibbonX xml passed to Excel -->
    <!-- This will only be loaded for Excel 2010 because of the namespace -->

    <customUI xmlns='http://schemas.microsoft.com/office/2009/07/customui' loadImage='LoadImage'>
      <ribbon>
        <tabs>
          <tab id='GRDBCustomTab' label='GRDB' getVisible='IsComputerConnectedToNetwork'>
            <group id='GrdbExportImport' label='Reporting'>
              <button id='btnQueriesAndTasks' label='Queries and Tasks' imageMso="FileSaveAsExcel97_2003" size='large' onAction='RunTagMacro' tag='OnQueriesAndTasks' />
              <button id='btnAdHocTimeSeries' label='Ad Hoc Time Series' imageMso="ChartFormatDataSeries" size='large' onAction='RunTagMacro' tag='GetTimeSeriesPoints' />
            </group >

            <group id='PortfolioHoldings' label='Portfolio Holdings' getVisible='AdHocActiveShareGetVisible'>
              <button id='btnAdHocActiveShare' label='Active Share Details' imageMso="CreateTable" size='large' onAction='RunTagMacro' tag='ShowActiveShareDerivation' />
            </group >

            <group id='grpHelp' label='Help'>
              <button id='btnAbout' label='About' imageMso="HelpDevResources" size='large' onAction='RunTagMacro' tag='ShowAboutBox' />
            </group >

            <group id='grpMaintenance' getVisible='AdminIsVisible' label='Maintenance'>
              <button id='btnGeneralMaintenance' label='General Maintenance' imageMso='FileCompactAndRepairDatabase' size='large' onAction='RunTagMacro' tag='OnGeneralMaintenance' />
              <button id='btnProcessConfiguration' label='Process Configuration' imageMso='AccessRelinkLists' size='large' onAction='RunTagMacro' tag='OnProcessConfiguration' />
            </group >

          </tab>
        </tabs>
      </ribbon>
    </customUI>

  </CustomUI>

</DnaLibrary>
augustoproiete commented 6 years ago

Hi @assenbog, I was not able to reproduce the error you get(*).

(*) See below the build output I get:

Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the NuGet Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
NuGet package restore finished.
1>------ Rebuild All started: Project: ExcelDNATest, Configuration: Debug Any CPU ------
1>Build started 5/25/2018 3:58:28 PM.
1>ExcelDnaClean:
1>  ---
1>  ExcelDnaBuild: ---
1>GenerateTargetFrameworkMonikerAttribute:
1>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>CoreCompile:
1>  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:C:\TEMP\___repro_error_malformed_dna\ExcelDNATest\packages\ExcelDna.Integration.0.34.6\lib\ExcelDna.Integration.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /link:C:\windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\ExcelDNATest.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /target:library /utf8output Class1.cs Properties\AssemblyInfo.cs RibbonCalls.cs "C:\Users\cproiete\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
1>  Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn
1>CopyFilesToOutputDirectory:
1>  Copying file from "obj\Debug\ExcelDNATest.dll" to "bin\Debug\ExcelDNATest.dll".
1>  ExcelDNATest -> C:\TEMP\___repro_error_malformed_dna\ExcelDNATest\ExcelDNATest\bin\Debug\ExcelDNATest.dll
1>  Copying file from "obj\Debug\ExcelDNATest.pdb" to "bin\Debug\ExcelDNATest.pdb".
1>ExcelDnaBuild:
1>  ---
1>  ExcelDnaBuild: ExcelDNATest-AddIn.dna -> bin\Debug\ExcelDNATest-AddIn.dna
1>  ExcelDnaBuild: ..\packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna.xll -> bin\Debug\ExcelDNATest-AddIn.xll
1>  ExcelDnaBuild: ExcelDNATest-AddIn.dna -> bin\Debug\ExcelDNATest-AddIn.dna
1>  ExcelDnaBuild: ..\packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna.xll -> bin\Debug\ExcelDNATest-AddIn.xll
1>  ExcelDnaBuild: ---
1>  ExcelDnaBuild: ExcelDNATest-AddIn.dna -> bin\Debug\ExcelDNATest-AddIn64.dna
1>  ExcelDnaBuild: ..\packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna64.xll -> bin\Debug\ExcelDNATest-AddIn64.xll
1>  ExcelDnaBuild: ExcelDNATest-AddIn.dna -> bin\Debug\ExcelDNATest-AddIn64.dna
1>  ExcelDnaBuild: ..\packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna64.xll -> bin\Debug\ExcelDNATest-AddIn64.xll
1>  ---
1>ExcelDnaPack:
1>  ExcelDnaPack: bin\Debug\ExcelDNATest-AddIn.dna -> bin\Debug\ExcelDNATest-AddIn-packed.xll
1>  "C:\TEMP\___repro_error_malformed_dna\ExcelDNATest\packages\ExcelDna.AddIn.0.34.6\tools\ExcelDnaPack.exe" "bin\Debug\ExcelDNATest-AddIn.dna" /Y  /O "bin\Debug\ExcelDNATest-AddIn-packed.xll"
1>  Using base add-in bin\Debug\ExcelDNATest-AddIn.xll
1>    ->  Updating resource: Type: ASSEMBLY_LZMA, Name: EXCELDNA.INTEGRATION, Length: 65894
1>    ~~> ExternalLibrary path ExcelDNATest.dll resolved to bin\Debug\ExcelDNATest.dll.
1>    ->  Updating resource: Type: DNA, Name: __MAIN__, Length: 1103
1>    ->  Updating resource: Type: ASSEMBLY_LZMA, Name: EXCELDNATEST, Length: 3470
1>  Completed Packing bin\Debug\ExcelDNATest-AddIn-packed.xll.
1>ExcelDnaPack:
1>  ExcelDnaPack: bin\Debug\ExcelDNATest-AddIn64.dna -> bin\Debug\ExcelDNATest-AddIn64-packed.xll
1>  "C:\TEMP\___repro_error_malformed_dna\ExcelDNATest\packages\ExcelDna.AddIn.0.34.6\tools\ExcelDnaPack.exe" "bin\Debug\ExcelDNATest-AddIn64.dna" /Y  /O "bin\Debug\ExcelDNATest-AddIn64-packed.xll"
1>  Using base add-in bin\Debug\ExcelDNATest-AddIn64.xll
1>    ~~> ExternalLibrary path ExcelDNATest.dll resolved to bin\Debug\ExcelDNATest.dll.
1>    ->  Updating resource: Type: DNA, Name: __MAIN__, Length: 1103
1>    ->  Updating resource: Type: ASSEMBLY_LZMA, Name: EXCELDNATEST, Length: 3470
1>    ->  Updating resource: Type: ASSEMBLY_LZMA, Name: EXCELDNA.INTEGRATION, Length: 65894
1>  Completed Packing bin\Debug\ExcelDNATest-AddIn64-packed.xll.
1>
1>Build succeeded.
1>    0 Warning(s)
1>    0 Error(s)
1>
1>Time Elapsed 00:00:03.99
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
assenbog commented 6 years ago

Hi Caio,

Thank you very much for your reply.

I have no references to ExcelDnaPack.exe.config at all and it doesn't appear in my output folder either, as I didn't even know it was required. Should I add it manually and what exactly is its role? I don't think it was required by the previous version, correct?

Thanks again

Assen

assenbog commented 6 years ago

Sorry, forgot to mention. ExcelDnaPack.exe.config has the exact same content, as the one referenced in the link you've provided earlier. Btw, I tried copying the ExcelDnaPack.exe.config to both my solution and output folders manually, but that didn't resolve the problem

augustoproiete commented 6 years ago

@assenbog:

assenbog commented 6 years ago

Hi Caio, Yes I can reproduce it on a different Windows 7 machine running VS2017 with the latest updates. Things were working fine when I was running v33, but observed the exact same problem when upgrading to 34 Thanks Assen

augustoproiete commented 5 years ago

@assenbog We've introduced a few changes in the loading of the XML file in ExcelDna.AddIn v1.0.0 if you'd like to try it out to see if it fixes the error above.

assenbog commented 5 years ago

Thank you very much for letting me know,  Caio.Kind regardsAssen Bogdanov  -------- Original message --------From: Caio Proiete notifications@github.com Date: 14/05/2019 22:56 (GMT+00:00) To: Excel-DNA/ExcelDna ExcelDna@noreply.github.com Cc: assenbog assenb@gmail.com, Mention mention@noreply.github.com Subject: Re: [Excel-DNA/ExcelDna] .dna could not be loaded exception demo (#200) @assenbog We've introduced a few changes in the loading of the XML file in ExcelDna.AddIn v1.0.0 if you'd like to try it out to see if it fixes the error above.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/Excel-DNA/ExcelDna/issues/200?email_source=notifications\u0026email_token=AJOIWQGV6FVT7VA7MRH3ALTPVMYRDA5CNFSM4FBWXM5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVM46FQ#issuecomment-492424982", "url": "https://github.com/Excel-DNA/ExcelDna/issues/200?email_source=notifications\u0026email_token=AJOIWQGV6FVT7VA7MRH3ALTPVMYRDA5CNFSM4FBWXM5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVM46FQ#issuecomment-492424982", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]