I'm having the same issue as TokyoDerm (different virus scanner on the client machine, but it's the same
ExcelDna.ManagedHost.dll file that's getting flagged).
This is my first .NET project, so I'm still a little confused about everything that happens in the background, and I could use a little more guidance.
1) I'm using ExcelDna v1.8.0
2) My original hope had been to pack everything into one file for ease of distribution, and I got that working as follows:
i) In the ExcelDna.Build.props file, I have the following:
<PropertyGroup>
<RunExcelDnaPack Condition="'$(RunExcelDnaPack)' == ''">true</RunExcelDnaPack>
<ExcelDnaPackXllSuffix Condition="'$(ExcelDnaPackXllSuffix)' == ''">-packed</ExcelDnaPackXllSuffix>
<!--
Options used when packing .xll files.
When in trouble with your virus scanner, try uncommenting at least the resource compression properties.
The default is true for both compression and multithreaded runs when not specified.
-->
<!--<ExcelDnaPackCompressResources Condition="'$(ConfigurationName)' == 'Debug'">false</ExcelDnaPackCompressResources>-->
<!--<ExcelDnaPackRunMultithreaded Condition="'$(ConfigurationName)' == 'Debug'">false</ExcelDnaPackRunMultithreaded>-->
<!--<ExcelDnaPackCompressResources Condition="'$(ConfigurationName)' == 'Release'">false</ExcelDnaPackCompressResources>-->
<!--<ExcelDnaPackRunMultithreaded Condition="'$(ConfigurationName)' == 'Release'">false</ExcelDnaPackRunMultithreaded>-->
</PropertyGroup>
ii)
in the \packages\ExcelDna.AddIn.1.8.0\build\ExcelDna.AddIn.props file, I have what I think is the default (I don't ever remember deliberately changing anything):
<Project>
<PropertyGroup>
<EnableDynamicLoading>true</EnableDynamicLoading>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<ExcelDnaPackNativeLibraryDependencies>true</ExcelDnaPackNativeLibraryDependencies>
<ExcelDnaPackManagedDependencies>true</ExcelDnaPackManagedDependencies>
</PropertyGroup>
</Project>
iii)
in the \packages\ExcelDna.AddIn.1.8.0\build\ExcelDna.AddIn.props file, I added an obfuscation step, running between ExcelDnaBuild and ExcelDnaPack, which obfuscates the projectname.dll file.
iv) in the <projectname>.dna file, I have:
- <ExternalLibrary Path="
projectname
.dll" ExplicitExports="false" ExplicitRegistration="true" LoadFromBytes="true" Pack="true" IncludePdb="false" />
- this is also where I've made sure to include all the dlls I need for the add-in, as in: <Reference Path="ExcelDna.IntelliSense.dll" Pack="true" />, as well as image files needed for the ribbon.
With all that, it runs perfectly smoothly, compiles to a single xll file, and installs without drama on my machine, and my co-workers.
From above, I see that I need to put <ExcelDnaUnpack>true</ExcelDnaUnpack> somewhere in the project, but I'm not entirely sure where (as in, what file, and where in that file).
i) Do I still need to bother packing the file, since it'll be a loose set of files that gets installed on the user's machine?
- if not, how best should I disable packing?
ii) When I look at the assemblies, the ExcelDna.ManagedHost.dll resides inside the ExcelDna64.xll file, alongside
ExcelDna.Integration.dll and
ExcelDna.Loader.dll, so I assume that those files get unpacked as well?
Sorry for the remedial questions.
Thanks,
Paul