簡體   English   中英

System.ArgumentException:'值不在預期范圍內。

[英]System.ArgumentException: 'Value does not fall within the expected range.'

我正在使用組策略管理dll收集策略的結果集。 我使用了一個類GPRSop ,其屬性為RsopMode和WMI Namspace作為字符串:

GPRsop test = new GPRsop(RsopMode.Logging, "Root/RSOP");
test.LoggingMode = LoggingMode.Computer;
test.LoggingComputer = "MyComputer";
test.LoggingUser = "domain\\user";
test.CreateQueryResults();
test.GenerateReportToFile(ReportType.Xml, "C:\\Temp\\test.xml");

LoggingModeLoggingComputerLoggingUser都拋出相同的異常:

System.ArgumentException:'值不在預期范圍內。

如果我按照建議設置wmiNamespace“”,它也會引發異常。

我必須以管理員身份運行Visual Studio。 之后,我什至不需要提供wmiNamespace。

謝謝你的幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM