私はC#2アプリケーションで開発しました。 1つのASP .NET WebサービスとWebサービスを使用するWinFormsクライアント。クライアントは多くの顧客に配布されます。これらの顧客の一つは、突然、アプリケーションは次の例外投げ始めた:C#.NET 2の例外:外部コンポーネントが例外をスローしました
External component has thrown an exception.
at System.Diagnostics.SharedPerformanceCounter.GetCounter(String counterName, String instanceName, Boolean enableReuse, PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName, PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
at System.Net.NetworkingPerfCounters.Initialize()
at System.Net.Configuration.SettingsSectionInternal..ctor(SettingsSection section)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.ServicePointManager.set_Expect100Continue(Boolean value)
at #Neh.#hgh.#P0f(String[] args)
を難読化された例外の終わりの機能、
public static void Main(string[] args) {
try {
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
System.Net.ServicePointManager.Expect100Continue = false;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Globals.Settings.NoWaitPrintJobs = true;
Application.Run(new frmMain());
}
catch(Exception ex) {
HandleUnhandledException(ex);
}
}
を次のようにあるクライアントの主な機能である(SmartAssembly 5を使用して)私はアプリケーションだけで、他の管理、任意の相互運用コンポーネントを参照していないライン
で破壊されていることを理解して例外からの
dll。また、シェルフォームのネイティブ関数を使用しています
[DllImport("shell32.dll")]
static extern bool SHGetSpecialFolderPath(IntPtr hwndOwner, [Out] StringBuilder lpszPath, int nFolder, bool fCreate);
静的オブジェクトからメインフォームのロードイベントで呼び出されています。
Globals.Settings.InitLocalFiles();
私はまだお客様のコンピュータの仕様を知りません。彼はWindows XPを持っていると思う。 何か考えてください。
例外の終了*での関数は、あなたが書いているように、例外を引き起こすものではありません。 'System.Diagnostics.SharedPerformanceCounter.GetCounter'は; [アクセス許可の問題のように聞こえる](http://stackoverflow.com/a/10517816/7724)。スタックトレースは、読み方を知っているときに本当に便利です。 :) – bzlm
ありがとう!私は明日顧客と一緒に見ていきます。 – alfoks