-4

在事件日志中,我得到以下信息,有人可以帮我解决这个问题。

Event Type: Error
Event Source:   .NET Runtime
Event Category: None
Event ID:   1026
Date:       01/06/2013
Time:       11:20:06
User:       N/A
Computer:   BISO
Description:
Application: TMS.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.SecurityException

Stack:    at System.ThrowHelper.ThrowSecurityException(System.ExceptionResource)
at Microsoft.Win32.RegistryKey.InternalOpenSubKey(System.String, Microsoft.Win32.RegistryKeyPermissionCheck, Int32)
at Microsoft.Win32.RegistryKey.OpenSubKey(System.String, Microsoft.Win32.RegistryKeyPermissionCheck, System.Security.AccessControl.RegistryRights)
at System.TimeZoneInfo.CheckDaylightSavingTimeDisabledDownlevel()
at System.TimeZoneInfo.TryCompareTimeZoneInformationToRegistry(TimeZoneInformation, System.String, Boolean ByRef)
at System.TimeZoneInfo.FindIdFromTimeZoneInformation(TimeZoneInformation, Boolean ByRef)
at System.TimeZoneInfo.GetLocalTimeZone()    
at System.TimeZoneInfo.get_Local()
at System.DateTime.ToLocalTime()
at System.DateTime.FromFileTime(Int64)
at System.Timers.ElapsedEventArgs..ctor(Int32, Int32)
at System.Timers.Timer.MyTimerCallback(System.Object)
at System.Threading._TimerCallback.TimerCallback_Context(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading._TimerCallback.PerformTimerCallback(System.Object)

有关详细信息,请参阅http://go.microsoft.com/fwlink/events.asp上的帮助和支持中心。

4

1 回答 1

1

我可以看到你有两个问题。

  1. 当您在自己的机器上运行它时,运行应用程序的帐户有权访问注册表,但是您在另一台机器上缺少此权限。当您在另一台机器上运行它时,您可以尝试以管理员身份运行它还是以升级的权限运行它?

  2. 您的代码 Timer_Elapsed 方法中没有足够的异常处理来尝试/捕获和处理异常,因此它会使整个应用程序崩溃。

还要检查是否有任何防病毒/安全软件在另一台机器上运行,这些软件可能正在沙箱化应用程序或阻止对注册表的访问

于 2013-05-31T11:28:10.847 回答