zzarchive-FSharp.Interop.ComProvider
zzarchive-FSharp.Interop.ComProvider copied to clipboard
"More than one nested type"
Description
Getting error FS3033 when trying to load "Microsoft Shell Controls And Automation"
Repro steps
- 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"
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.