Specifying dlls to be packed in the .net 6 csproj file #595
-
Hi there, I'm trying to transition my ExcelDna project from .net framework to .net 6.0, and in the process define my exceldna properties in the .csproj file rather than the .dna file. I've removed the .dna file completely from the project and I've successfully added some dna properties as per the screenshot below. However I would like to add the list of assemblies that need to be packed, if I don't do this then it seems that some assemblies get missed. Please can someone advise on how to manually list the dlls to be packed? As an example I tried using the ExcelAddInInclude property for a single dll that's in the bin folder, but I get an error. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
TLDR; (1) You should not have the extra lines in the
TLDR; (2) But it should all work without the It did take me a bit to notice this, so here is some of the missing documentation I wrote along the way. If you are targeting .NET 6, then the assemblies (and also native runtime dependencies) to be packed should be picked up from the .deps.json file (be sure to use that latest 1.7.0-rc2 version to test this). If this does not work right for you, please give some more details for us to look at. This dependency mapping from the .deps.json file can be disabled with these properties
You can add assemblies to the packing list with a property
If you want to generate the packing list from the list of .dll files in the output, you can do this with a Target the builds the
The error you show is because you are explicitly adding Microsoft.Logging.Extensions.dll to the packing list, but it appears that this library is not found in the output directory. I think the reason has to do with the formatting of your property, leading to a the task looking for a file with spaces before and after the name. Hence the packing task is failing. @Sergey-Vlasov Can we please trim the
or
Should we consider also supporting a line-end delimited list like this (without the semi-colons)?
Are there msbuild file conventions arounds this? |
Beta Was this translation helpful? Give feedback.
-
@Sergey-Vlasov Looking at https://learn.microsoft.com/en-us/visualstudio/msbuild/comparing-properties-and-items?source=recommendations&view=vs-2022 I think we don't have to support the list without the semi-colons - the semi-colons seem standard, but they do have an example with an extra semi-colon at the end,
so we should support something like
|
Beta Was this translation helpful? Give feedback.
-
how can I pack the appsettings.json into the xll? |
Beta Was this translation helpful? Give feedback.
-
I suggest that additional files like that should be built into your own .dll file as resources. This uses standard .NET mechanism as described here: |
Beta Was this translation helpful? Give feedback.
TLDR; (1) You should not have the extra lines in the
ExcelAddInInclude
property. Make it like this:TLDR; (2) But it should all work without the
ExcelAddInInclude
, if you are using the latest ExcelDna.AddIn package version 1.7.0-rc3.It did take me a bit to notice this, so here is some of the missing documentation I wrote along the way.
If you are targeting .NET 6, then the assemblies (and also native runtime dependencies) to be packed should be picked up from the .deps.json file (be sure to use that latest 1.7.0-rc2 version to test this). If this does not work right for you, please give some more details for us to l…