You need to make sure the assembly redirections are put in the .xll.config file.
* Rename the App.Config file that the Roslyn package made to RoslynTest-AddIn.xll.config (your name...)
To set it up for the packing, you have to add all the assemblies that are pulled in from the NuGet package. My .dna file ended up looking like this:
<DnaLibrary Name="RoslynScripting Add-In" RuntimeVersion="v4.0">
<ExternalLibrary Path="RoslynScripting.dll" LoadFromBytes="true" Pack="true" />
<Reference Path="System.Reflection.Metadata.dll" Pack="true" />
<Reference Path="System.Collections.Immutable.dll" Pack="true" />
<Reference Path="System.Console.dll" Pack="true" />
<Reference Path="System.Diagnostics.FileVersionInfo.dll" Pack="true" />
<Reference Path="System.Diagnostics.StackTrace.dll" Pack="true" />
<Reference Path="System.IO.FileSystem.dll" Pack="true" />
<Reference Path="System.IO.FileSystem.Primitives.dll" Pack="true" />
<Reference Path="System.Security.Cryptography.Algorithms.dll" Pack="true" />
<Reference Path="System.Security.Cryptography.Encoding.dll" Pack="true" />
<Reference Path="System.Security.Cryptography.Primitives.dll" Pack="true" />
<Reference Path="System.Security.Cryptography.X509Certificates.dll" Pack="true" />
<Reference Path="System.Text.Encoding.CodePages.dll" Pack="true" />
<Reference Path="System.Threading.Thread.dll" Pack="true" />
<Reference Path="System.Xml.XmlDocument.dll" Pack="true" />
<Reference Path="System.Xml.XPath.dll" Pack="true" />
<Reference Path="System.Xml.XPath.XDocument.dll" Pack="true" />
<Reference Path="Microsoft.CodeAnalysis.CSharp.dll" Pack="true" />
<Reference Path="Microsoft.CodeAnalysis.CSharp.Scripting.dll" Pack="true" />
<Reference Path="Microsoft.CodeAnalysis.dll" Pack="true" />
<Reference Path="Microsoft.CodeAnalysis.Scripting.dll" Pack="true" />
<Reference Path="RoslynScripting.dll" Pack="true" />
<Reference Path="System.AppContext.dll" Pack="true" />
</DnaLibrary>
But I did not run into any this issue when trying out your example.
I agree it opens up some exciting possibilities.
A simple expression evaluator add-in would be a nice sample.
Let us know what you try next.