Excel-DNA / Excel-DNA/ExcelDna

RTD functions don't work when Excel requires signing

Open
#298 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
292
Avg merge
20d 12h
Merged PRs (30d)
1

Description

Hi

This is kinda similar to #141 but I thought I'd writeup exactly why this isn't working:

Sample testcase:

- Start Excel, ensure in trustcenter that "Require Application Add.ins to be signed by Trusted Publisher" is ticked.
- Create new ExcelDna addin as per normal
Add code:
```
[ExcelFunction(Description = "My first .NET function")]
public static object SayHelloAsync(string name)
{
return ExcelAsyncUtil.Run("RunSomethingDelay", null, () => RunSomethingDelay());
}

public static string RunSomethingDelay()
{
Thread.Sleep(2000);
return "test";
}
```
Try and use it: you should get the following warning:
![image](https://user-images.githubusercontent.com/23338/74539186-e3b34f00-4f3d-11ea-9129-438bb10e64c6.png)

We see that the call succeeded:
![image](https://user-images.githubusercontent.com/23338/74539163-ddbd6e00-4f3d-11ea-92cd-27ef7a4105be.png)

We then don't actually manage to create the RTD server, but Excel reports success. We add this to loadedRtdServers, so when further calls try and use the RTD functions (after accepting the security warning), we try and use the RTD server that never started.

I'd very much like to try and fix this, any guidance to the preferred way? It seems that somehow we need to track the point of the RTD server actually starting up, not just the request to start it up. Otherwise I'll see if I can create something to fix this.

Thanks,
Steve

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.