none
Compiling an IRtdServer Interface for Excel RTD() Function in .Net Core RRS feed

  • Question

  • Hello there

    Is it possible to implement an IRtdServer interface for use by Excel in a .Net core project?

    I have an existing .Net 4.6.1 framework project which I am looking to upgrade to .Net Core 3.  I am using Visual Studio 2019 Preview, version 3.0.100 preview9 of the .Net Core 3 SDK, and C#.

    The heart of this project is a class to communicate with Excel using Excel’s RTD function:

    [Guid("2B70D74D-A4F6-485F-8CDF-4CE514E75183")]

        [ProgId("Ameritrade.RTD")]

        [ComVisible(true)]

        public class RtdQuoteServer : IRtdServer

        {

    To create the interface for the.Net Framework project, I use the following:

    %SystemRoot%\Microsoft.Net\Framework64\v4.0.30319\RegAsm.exe %~dp0\AmeritradeRtd\bin\Debug\AmeritradeRtd.dll /codebase

    This works fine for the .Net framework version.  I have ported the application to .Net core, but have been unable to get it to work.

    Running RegAsm against the .Net core dll generates the following error:

    regasm: error RA0000 : could not load file or assembly System.Runtime, version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.  The system cannot find the file specified.

    I found this article, indicating that creating COM components is now supported in .Net Core 3.0 - https://docs.microsoft.com/en-us/dotnet/core/native-interop/expose-components-to-com

    I have attempted to register the DLL:

    regsvr32 "C:\Projects\DEC Decision Capital\ARTHyperion\AmeritradeRtdCore\bin\Debug\netcoreapp3.0\AmeritradeRtdCore.comhost.dll"

    This gives three different results on three different PCs:

    1)

    Regsvr32 Error

    2)

    No error is displayed, but the registration doesn’t work.

    3)

    The registration succeeds, however the underlying issue remains, i.e. I can’t get Excel to communicate with it.

     

    Any help greatly appreciated.

    Geoff Olding


    Thursday, September 19, 2019 9:26 PM

All replies

  • Hi,

    Based on the description, I will move this thread to Excel for Developer forum:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,

    Emi Zhang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Office 2019.

    Friday, September 20, 2019 2:01 AM