Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate assembly redirection in .xll.config files #41

Open
govert opened this issue Oct 21, 2015 · 6 comments
Open

Investigate assembly redirection in .xll.config files #41

govert opened this issue Oct 21, 2015 · 6 comments

Comments

@govert
Copy link
Member

govert commented Oct 21, 2015

It seems that assembly redirection specified in .xll.config files is not applied.
Investigate and document or fix.

@augustoproiete
Copy link
Member

@henningniss
Copy link

Below is a reproduction scenario.

(0. Get Portable.Licensing using NuGet.)

  1. Compile the cs file to a dll
  2. Pack with ExcelDnaPack to an xll
  3. Copy the xll file to a directory without System.Xml.Linq.
  4. Start Excel with the xll and inspect the debug output.

This uses reproduction scenario uses Portable.Licensing as an example, but I am sure other libraries referencing portable versions of GAC'ed dll's would illustrate the problem just as well.

DNA:
<DnaLibrary Language="CS" RuntimeVersion="v4.0">
<ExternalLibrary Path="MyAddIn.dll" Pack="true" />
<Reference Path="Portable.Licensing.dll" Pack="true" />
</DnaLibrary>

CS:

using System;
using System.Diagnostics;
using ExcelDna.Integration;
using Portable.Licensing;

namespace MyAddIn
{
  public sealed class MyAddInHelper : IExcelAddIn
  {
    public void AutoOpen()
    {
       Debug.WriteLine("In AutoOpen()");
       try
       {
          var contents = "<?xml version=\"1.0\" encoding=\"utf-8\"?><gibberish />";
          var license = License.Load(contents);
       }
       catch (Exception e)
       {
          Debug.WriteLine("Exception: {0}", e.Message);
          throw;
       }
    }

    public void AutoClose()
    {
       Debug.WriteLine("In AutoClose()");
    }
  }
}

@konne
Copy link
Contributor

konne commented Nov 2, 2015

Hi henningniss ,
What I miss in your DNA File is the bouncing castle dll, but I didn't test your problem till now.
If you like you can also check my branch version. https://github.com/konne/ExcelDna I have changed the whole area for finding the right assembly and I also solved the issue with portable dlls (I had the problem with autofac)
If you don't get your test working with my branch I will try to test this in the end of week and debug into this issue.

bye
Konrad

@henningniss
Copy link

Hi Konrad

Forgive my ignorance, but I thought that Bouncy Castle (to the extent that I knew of its existence) was already part of the Portable.Licensing dll, and hence not required as a separate dependency.

I'll try to find some time to test your branch as well.

Henning

@stonefly
Copy link

any update on this issue?

@govert
Copy link
Member Author

govert commented Jun 16, 2016

I've not had a closer look at this yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants