Interview Question in Visual Studio 2005


 

Interview Question :: Exception when I run a program developed with cSharp .net 2.0

I used visual studio 2005 to developed an application. it was working well. recenty i used "Computerinfo" class of "Microsoft.VisualBasic.Devices" namespace. for which I had to add a visual basic dll as reference. But my problem is when I run the program from Visual Studio 2005 IDE It works fine. but after publishing It throws an exception with 'detail', 'quit' and 'continue' button.

************** Exception Text **************
System.Management.ManagementException: Provider load failure
at System.Management.ManagementException.Th... errorCode)
at System.Management.ManagementObjectCollec...
at System.Management.ManagementObjectCollec...
at Microsoft.VisualBasic.Devices.ComputerIn...
at Microsoft.VisualBasic.Devices.ComputerIn...
at MountUp.MainUI.MainUI_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(.....
by ksk