Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when trying to add some COM references #278

Closed
eugbaranov opened this issue Feb 27, 2015 · 4 comments
Closed

NullReferenceException when trying to add some COM references #278

eugbaranov opened this issue Feb 27, 2015 · 4 comments
Labels

Comments

@eugbaranov
Copy link

When I try adding 'Microsoft Windows Installer Object Library' as a COM reference to my F# project it fails with "Object reference not set to an instance of an object":
image

Well, when I try doing that for a C# project if fails too, although with a different error:
image

However for a C# I can "Browse..." to a DLL directly by "C:\Windows\System32\msi.dll" and this adds COM reference just fine, but for F# this approach still fails with the same NullReferenceException.

@enricosada
Copy link
Contributor

i can repro

the line is ComReferenceNode.cs#L370

the lcid used ( 0 ) to find the key target an invalid regedit key

invalid with lcid 0
HKEY_CLASSES_ROOT\TypeLib\{000C1092-0000-0000-C000-000000000046}\1.0\0\win32

valid on my machine (ldic 409) and valid C:\Windows\system32\msi.dll path
HKEY_CLASSES_ROOT\TypeLib\{000C1092-0000-0000-C000-000000000046}\1.0\409\win32

i am debugging this one

@enricosada
Copy link
Contributor

ok, fixed. i'll add a pr soon

enricosada added a commit to enricosada/visualfsharp that referenced this issue Feb 27, 2015
lcid is an integer
fix typelib registry path, the lcid part is the hexadecimal string representation of the lcid value
added exception on failed add reference
fix nre on if registry key not found

fix dotnet#278
@latkin latkin added the Bug label Feb 27, 2015
latkin pushed a commit that referenced this issue Mar 5, 2015
lcid is an integer
fix typelib registry path, the lcid part is the hexadecimal string representation of the lcid value
added exception on failed add reference
fix nre on if registry key not found

fixes #278
closes #281

commit 64185d2
Author: enricosada <enrico@sada.io>
Date:   Tue Mar 3 21:45:40 2015 +0100

    add test

commit c4fb65d
Author: enricosada <enrico@sada.io>
Date:   Fri Feb 27 19:31:29 2015 +0100

    remove unused try/catch

commit 4a05993
Author: enricosada <enrico@sada.io>
Date:   Fri Feb 27 18:47:03 2015 +0100

    fix add file reference (com dll)

    lcid is an integer
    fix typelib registry path, the lcid part is the hexadecimal string representation of the lcid value
    added exception on failed add reference
    fix nre on if registry key not found

    fix #278
@dungpa
Copy link
Contributor

dungpa commented Mar 11, 2015

Should this one be closed?

@latkin latkin added the fixed label Mar 11, 2015
@latkin
Copy link
Contributor

latkin commented Mar 11, 2015

Yep, thanks

@latkin latkin closed this as completed Mar 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants