MonitorFactory icon indicating copy to clipboard operation
MonitorFactory copied to clipboard

DataGridViewAutoSizeColumnMode type not found

Open jrconley4 opened this issue 9 years ago • 1 comments

After removing AsJob = $true in sqlmonitor.ps1, received an unknown type error.

Unable to find type [DataGridViewAutoSizeColumnMode]. At ...\PowerShell\Modules\MonitorFactory\Components\Start-Monitor.ps1:506 char:22

  •         $_.AutoSizeMode = [DataGridViewAutoSizeColumnMode]::None
    
  •                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (DataGridViewAutoSizeColumnMode:TypeName) [], RuntimeException
    • FullyQualifiedErrorId : TypeNotFound

I had to fully qualify DataGridViewAutoSizeColumnMode at line 506 in start-monitor.ps1

$_.AutoSizeMode = [System.Windows.Forms.DataGridViewAutoSizeColumnMode]::None

Was I doing something wrong and did my "fix" actually fix something, or did some other cosmic event take place that made it run without throwing an error?

jrconley4 avatar Apr 28 '17 19:04 jrconley4

Thanks, jrconley4. Most likely this was my error: likely when I tested that code path I had already had the library in my environment so it found it without a fully qualified path. I just updated the code exactly as you surmised to provide the full path.

msorens avatar Apr 29 '17 00:04 msorens