Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Sophos blocking add-in

111 views
Skip to first unread message

TokyoDerm

unread,
Apr 29, 2024, 8:31:55 AM4/29/24
to Excel-DNA
Hi, Pls see below. It was working fine a few days previously so I guess Sophos did some updates. We added the path to the Sophos 'Allowed Applications' list but it didn't fix the problem. There is a ticket created with their support desk so waiting to hear back but in the meantime, can you think of any way to avoid it being flagged in the first place?

FYI, we're using Excel-DNA v1.8.0-alpha3 from NuGet.

Thanks!

Dermot

sophos.png

Govert van Drimmelen

unread,
Apr 29, 2024, 12:50:10 PM4/29/24
to exce...@googlegroups.com

Sometimes that anti-virus programs get anxious about the assemblies that are embedded as resources in the add-in .xll file.

One way you can check for this is to make a fully ‘unpacked’ add-in, and see if that avoids some problems.

 

For this you could set an extra project property

 

    <ExcelDnaUnpack>true</ExcelDnaUnpack>

 

After this, you should see a difference in the output written to the ‘publish’ directory.

In addition to the two.xll files, you’ll get all the dependencies from Excel-DNA (like ExcelDna.ManagedHost.dll) and your add-in as loose file copied to ‘publish’ as well. This whole directory is now needed to run your add-in, but doing it this way might avoid the anti-virus.

 

-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/3f44a5f8-9d45-498d-b851-59ae2681cdf4n%40googlegroups.com.

image001.png

TokyoDerm

unread,
Jun 3, 2024, 11:09:40 PM6/3/24
to Excel-DNA
Govert - that worked. Thank You!
Dermot

P Mac

unread,
Jan 2, 2025, 5:22:46 PMJan 2
to Excel-DNA
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
Reply all
Reply to author
Forward
0 new messages