zzarchive-FSharp.Interop.ComProvider icon indicating copy to clipboard operation
zzarchive-FSharp.Interop.ComProvider copied to clipboard

"More than one nested type"

Open Whil- opened this issue 6 years ago • 1 comments

Description

Getting error FS3033 when trying to load "Microsoft Shell Controls And Automation"

Repro steps

  1. Step A In a .fsx-file, run the following (after fetching latest version from NuGet):
#r @"C:\temp\180819\FSharp.ComProvider.dll"
type shell = TypeLib.``Microsoft Shell Controls And Automation``.``1.0``

Expected behavior

Not error...

Actual behavior

error FS3033: The type provider 'FSharp.ComProvider.ComProvider' reported an error: There is more than one nested type called '1.0' in type 'TypeLib.Microsoft Shell Controls And Automation'

Related information

  • Operating system

Windows 10

  • Branch
  • .NET Runtime, CoreCLR or Mono Version

Runtime from latest version of Visual Studio 15.8. Tried in both Visual Studio and Emacs.

"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/FSharp/fsi.exe" "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/FSharp/fsc.exe"

Whil- avatar Aug 19 '18 01:08 Whil-

Thank you for your report.

This sounds like the Com Provider is finding multiple registry entries for that typelib version on your machine and failing to filter them down. I haven't looked at this project for awhile, but I'll see if I can create a new release soon that uses some newer code that may address the issue.

In the mean time, if you need to do COM interop via F#, I'd recommend adding a COM Reference to your project via Visual Studio or running the underlying tlbimp.exe to generate an interop assembly.

lasandell avatar Aug 21 '18 14:08 lasandell