How to install/add System.Management.dll into GAC where gacutil.exe is not available at the host server. Manual copy paste is not working.
Problem Description
I have a C#.NET 3.5 application where I am using System.Management namespace to read USB Serial Device. Following code is working fine at development machine but when we deploy this exe on the server where System.Management.dll is available into target framework directory but it is missing at GAC location (file:///C:/windows/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll ).
Exception StackTrace
System.Management.ManagementException: Not found
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at ComPort.Form1.GetUSBDevices() in E:\NPPC\PRAVEEN\POC\ComPort\ComPort\Form1.cs:line 46
at ComPort.Form1.BindDDL() in E:\NPPC\PRAVEEN\POC\ComPort\ComPort\Form1.cs:line 28
at ComPort.Form1.button1_Click(Object sender, EventArgs e) in E:\NPPC\PRAVEEN\POC\ComPort\ComPort\Form1.cs:line 36
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Jignesh KumarRank #91 · 22.9K reputationPosted Apr 10, 2021, 3:39 AM EDT
Salman BegRank #284 · 8.8K reputationPosted Apr 10, 2021, 3:47 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Apr 10, 2021, 5:14 AM EDT