1

The context is an ASP.NET 5 (RC1 at the moment) application, so using project.json for references and .xproj for Visual Studio. The application targets the full .NET 4.6 framework only (no .net Core support).

I need to use third-party services, which are exposed as COM interfaces.

What is the best way to add them to my project? I couldn't find any information about that.

My intuition is that I'll need to create a "classic" .net dll that uses the COM component, using csproj and the "old" build tools, etc. And then reference that dll as a binary reference from my ASP.NET 5 project.

Does that seem right? Any other way?

jods
  • 4,581
  • 16
  • 20

2 Answers2

1

We don't have any support for adding com references to the new project system. File a feature request on github.

davidfowl
  • 37,120
  • 7
  • 93
  • 103
  • Thanks David. I won't create a feature request as I don't care much for COM and I don't think it fits well with the portable .net Core philosophy. Referencing another dll is fine by me. – jods Dec 07 '15 at 09:57
0

As per https://stackoverflow.com/a/27198637/3757876 it looks like you need to create a Nuget package for your com component.

This question addresses using your com component as a dll.

I used Nuget Package Explorer to pack my dll up as a nugget package.

After that, I created a local Nuget repository that my project pulls from.

Community
  • 1
  • 1
JonTheMon
  • 381
  • 2
  • 9
  • Thanks. Actually, you don't need Nuget packages to reference binary dll. You can reference them as project dependencies, if you create a special kind of project that looks like this: `{ "frameworks": { "dnx46": { "bin": { "assembly": "My.dll" } } } }` – jods Dec 04 '15 at 18:28
  • 1
    The question was not about referencing dlls but more about how to add **COM** into the new project system. From your answer I assume that you'd follow the same solution that I outlined: create a .net 4.6 DLL the old-school way (csproj) and reference that binary? – jods Dec 04 '15 at 18:31