Hi Hamish,
I’m sorry, you are right. When targeting .NET Framework you do still need the explicit packing directive as you show.
In my test I also reduced the list of PackageReferences to this:
<ItemGroup>
<PackageReference Include="ExcelDna.AddIn" Version="1.7.0-rc1" />
<PackageReference Include="GenericParser" Version="1.1.6" />
<PackageReference Include="Microsoft.Data.Analysis" Version="0.20.0" />
</ItemGroup>
So I removed the explicit packages that look like this:
Microsoft.NETFramework.ReferenceAssemblies
System.Reflection.MetaData
Without these extra packages, and adding the <Target Name=”PackedReference” etc. as you show, the project builds (and does not have the System.Reflection.MetaData.dll in the output directory. And both the unpacked and packed versions work at least somewhat.
Are you sure you need the additional packages, beyond the three I show above?
They seem all that is required to build, and should pull in their further dependencies.
In particular, do you have a specific reason for including System.Reflection.MetaData?
Otherwise, there are some further ways to tweak the packing list, and we figure out how to exclude a specific file from the generated list.
Regards,
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/94fa27db-c2be-4ded-9446-b420085c5f7en%40googlegroups.com.
Hi Hamish,
Sorry, my message was not quite clear about the extra <Target>.
This is my project file – can you try like this.
-Govert
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="Data\CropCoefficientTableFull.csv" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Data\CropCoefficientTableFull.csv" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ExcelDna.AddIn" Version="1.7.0-rc1" />
<PackageReference Include="GenericParser" Version="1.1.6" />
<PackageReference Include="Microsoft.Data.Analysis" Version="0.20.0" />
</ItemGroup>
<Target Name="PackedReferences" AfterTargets="AfterBuild" BeforeTargets="ExcelDnaBuild">
<ItemGroup>
<References Include="$(OutDir)*.dll" Exclude="$(OutDir)$(TargetFileName)"/>
</ItemGroup>
<PropertyGroup>
<ExcelAddInInclude>@(References)</ExcelAddInInclude>
</PropertyGroup>
</Target>
</Project>
--
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/498228b9-7d22-4a8e-a300-db31533160ebn%40googlegroups.com.