ExternalLibrarynot found

174 views
Skip to first unread message

Rayane

unread,
Oct 5, 2023, 8:56:42 AM10/5/23
to Excel-DNA
When testing Excel-dna to see if it could fit my project, I got the following 2 errors : 

!!! ERROR: ExternalLibrary `%OutputFileName%` not found. ABORTING.

System.InvalidOperationException: !!! ERROR: ExternalLibrary `%OutputFileName%` not found. ABORTING.
   at ExcelDna.PackedResources.ExcelDnaPack.PackDnaLibrary(Byte[] dnaContent, String dnaDirectory, ResourceUpdater ru, Boolean compress, Boolean multithreading, List`1 filesToPublish)
   at ExcelDna.PackedResources.ExcelDnaPack.Pack(String dnaPath, String xllOutputPathParam, Boolean compress, Boolean multithreading, Boolean overwrite, String usageInfo, List`1 filesToPublish)
   at ExcelDna.AddIn.Tasks.PackExcelAddIn.Execute()


I'm using a Class Libray in the .NET Framework 4.7.2 which I understood it worked with.

Any guidance ? 

Rayane

unread,
Oct 5, 2023, 9:42:15 AM10/5/23
to Excel-DNA
ok solution was simple enough, i just created a new project based on .Net 6.0. However, my class library are developed on .Net Framework 4.7.2 so I hope the two are compatible.

Govert van Drimmelen

unread,
Oct 5, 2023, 9:45:14 AM10/5/23
to exce...@googlegroups.com

I think the problem was the project file format, which is different depending on which Visual Studio template (called .NET Framework or not) you pick.

 

Excel-DNA supports .NET Framework, and your life will be better by targeting it.

Just change the TargetFramework in the project file, like this:

 

<Project Sdk="Microsoft.NET.Sdk">

 

      <PropertyGroup>

            <TargetFramework>net472</TargetFramework>

      </PropertyGroup>

 

      <ItemGroup>

            <PackageReference Include="ExcelDna.Addin" Version="1.7.0-rc6" />

      </ItemGroup>

 

</Project>

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/2f58cfef-884f-4205-a819-3e71da950f58n%40googlegroups.com.

Rayane

unread,
Oct 5, 2023, 10:11:11 AM10/5/23
to Excel-DNA
thank you for your feedback. Just to confirm : you're telling m eto discard the projet in .NET 6.0 and create a new projet in .Net Framework 4.7.2 ?

Govert van Drimmelen

unread,
Oct 5, 2023, 10:24:29 AM10/5/23
to exce...@googlegroups.com

No, you can just edit the .csproj file that you have working with .NET 6, but update the TargetFramework, save it and rebuild.

The new ‘SDK-style’ project files are nicer than the old project files, and support both .NET Framework and .NET core projects.

You might need to remove some extra properties for features that .NET Framework does not support, like ‘Nullable’.

Rayane

unread,
Oct 6, 2023, 8:42:28 AM10/6/23
to Excel-DNA
I've changed TargetFramework to net472.

However, I had the following errors : "Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater."

What should I do ?

Here below is the csproj file.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <RootNamespace>CSA_Addin</RootNamespace>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ExcelDna.AddIn" Version="1.6.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\DayCountClassLibrary\DayCounts.csproj" />
    <ProjectReference Include="..\FinancialInstruments2\FinancialInstruments2.csproj" />
  </ItemGroup>

</Project>

Rayane

unread,
Oct 6, 2023, 8:49:31 AM10/6/23
to Excel-DNA
I've removed those 3 lines : 
<RootNamespace>CSA_Addin</RootNamespace>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

and the Rebuild worked.

However, I'm not unsure about the consequences.

Message has been deleted

Albrecht Hilmes

unread,
Jun 18, 2025, 4:16:32 PMJun 18
to Excel-DNA
Thank you for this thread.
I have the same error message, but unfortunately I cannot implement the suggested solution.
Conditions of my project:
   -   Operating system: Windows 11
   -   Excel Microsoft 365 apps for business (64-bit)
   -   Visual Studio Community 2022 (64-bit)
   -  .NET Framework 4.7.2
   -   ExcelDna.AddIn 1.8.0
   -   ExcelDna.Integration 1.8.0

There are two "csproj" files:
   - ExcelDNATest_005.csproj
   - ExcelDNATest_005.csproj.user

Unfortunately, I cannot find the string "Project Sdk="Microsoft.NET.Sdk">" in either file.

So where can I place the information "<TargetFramework>net472</TargetFramework>"?

Best regards,
Albrecht

Albrecht Hilmes

unread,
Jul 2, 2025, 2:44:02 AMJul 2
to Excel-DNA
Is there any news or an interim status?
Herzliche Grüße
Albrecht Hilmes

Govert van Drimmelen

unread,
Jul 2, 2025, 2:52:36 AMJul 2
to Excel-DNA
Please start a new discussion with your error and context.
Is it a new project, or existing one you're upgrading, etc.?

-Govert

Albrecht Hilmes

unread,
Jul 2, 2025, 3:00:17 AMJul 2
to Excel-DNA
I get this error message when creating a new simple project. Unfortunately, I cannot use Excel-DNA at all under my above configuration.
Albrecht

Govert van Drimmelen

unread,
Jul 2, 2025, 6:09:35 AMJul 2
to Excel-DNA
Hi Albrecht,

Please start a new discussion with your error.

-Govert

Albrecht Hilmes

unread,
Jul 2, 2025, 8:44:39 AMJul 2
to Excel-DNA
Thank you Govert. I started new discussion.
Best Regards
Albrecht Hilmes
Reply all
Reply to author
Forward
0 new messages