tags:

views:

484

answers:

2

Hello,

I have an application that I am upgrading from the .NET 3.5 to the .NET 4.0 framework. It uses a COM library which is referenced. It works no problem in 3.5 but after converting to 4.0 I have issues getting the COM to work. The COM is from a 3rd party so we didn't develop it ourselves.

I get the following COM error (generic COM error, not specific to the COM object itself): hr = 0x8007000b

CLR gives me: 'The invocation of the constructor on type 'Skype_Business_Launcher.Main' that matches the specified binding constraints threw an exception.' Line number '3' and line position '5'.

And the C# logs:

=== Pre-bind state information === LOG: User = \phillip LOG: DisplayName = Interop.SKYPE4COMLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (Fully-specified) LOG: Appbase = file:///bin/Debug/ LOG: Initial PrivatePath = NULL

Calling assembly : Skype Business Launcher, Version=1.0.5.0, Culture=neutral, PublicKeyToken=null.

LOG: This bind starts in default load context. LOG: Using application configuration file: LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///bin/Debug/Interop.SKYPE4COMLib.DLL. ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

I removed the pathname for security reasons but I have checked all the path information and it's all correct. Also the COM library file exists where it's pointing to. It's also copied to the OBJ folder within the project as well.

Originally I was getting an error about the COM library not supporting embedded types so I made "Embed Interop Types" false (it was true below) and the error went away but I'm not sure if thats connected to this error or not so I thought I'd mention it just in case.

Again, it works just fine with 3.5.

Thanks,

+1  A: 

A shot in the dark: it looks like you are using the x64 version of the framework. Was that already the case with 3.5 ? And is the COM server a DLL or an EXE ?

If the COM server is a DLL, there needs to be a "bitness" match between the DLL and your program.

Timores
A: 

when you convert your project to 4.0 the IDE can perform a issue to convert COM library into 4.0.

when you convert your project to 4.0 remove com library then Re include it in your project then i thing it should be works.

steven spielberg