- I have a console application and a wpf application.
on both applications I have added the skype4com.dll reference
The code:
SKYPE4COMLib.Skype oSkype = new SKYPE4COMLib.Skype();
gives an: InvalidCastExeption
stating:
Unable to cast COM object of type 'System.__ComObject' to interface type 'SKYPE4COMLib.Skype'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B1878BFE-53D3-402E-8C86-190B19AF70D5}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
but when I run the same line of code in my wpf application I don't get an exception. why!?
My console application was running great until skype updated. I uninstalled skype, installed it again in order to try to solve the problem but that did not help.
After long hours of trying I decided I where going to make my wpf application a console application by adding the necessary references and classes. Then I compared and I noticed that if I added:
to the main method it works!!!!!
as a result my main method now should look like:
using System; using System.Collections.Generic; using System.Linq; using System.Text;
on asp.net there is not a main method. well not one that I know of. so in asp.net I had to add the AspCompat attribute equal to true.
so my asp.net aspx pages now look like: