Récupération d'un projet VB.NET hérité écrit à l'origine pour la version 1.1 du framework .NET. Je cours Vista avec .NET 3.5. J'ai éliminé toute l'erreur initiale et le projet va se construire; ça ne fonctionnera pas. Pour autant que je sache, il essaye d'exécuter 'LoginForm' mais mettre des points d'arrêt ne fonctionne pas parce que l'erreur est levée avant que les points d'arrêt soient atteints, quel que soit l'endroit où ils sont placés.IndexOutOfRangeException dans VB.NET
Vraiment ne peut pas savoir quoi faire! Toute aide appréciée.
StackTrace:
System.IndexOutOfRangeException was unhandled Message="Index was outside the bounds of the array." Source="FirstLine" StackTrace: at FirstLine.LoginForm.main() at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
EDIT: Terriblement désolé, n'a pas apprécié le code serait d'une grande utilité parce que la question est plus que je ne peux pas y accéder. Cependant, voici la fonction principale:
Shared Sub main() Dim p As Process() = Process.GetProcessesByName("FirstLine") If p.Length = 1 Then 'START COPYMINDER 'Dim expirydate As Date = CDate("01/01/1970") 'Dim expiry As Integer 'Try ' GetCopyMinderExpiryDate(expiry) ' If Not expiry = 0 And Not expiry = 1 Then ' expirydate = expirydate.AddSeconds(expiry) ' Dim diff As Integer = DateDiff(DateInterval.Day, Date.Now, expirydate) ' If diff >= 0 And diff 0 Then ' DisplayError((ret_code)) ' End 'End If 'Dim did As String 'GetCopyMinderDeveloperID(did) 'If did "IT" Then ' MessageBox.Show("Invalid Developer ID " & did & ". Firstline will now shutdown", "Firstline", MessageBoxButtons.OK, MessageBoxIcon.Error) ' End 'End If 'END COPYMINDER Dim lf As New LoginForm If LoginSettings.setting("loginShowErrorOnLine") = "TRUE" Then lf.ShowDialog() Else Try lf.ShowDialog() Catch ex As Exception MsgBox(ex.Message) Config.UnlockByUser(Config.currentUser.username) Config.currentUser.UserLoggedOff() End Try End If Else Dim prc As Process = p(0) SwitchToThisWindow(prc.MainWindowHandle, True) End If End Sub
Merci pour vos réponses à ce jour. C'est encourageant de voir une communauté si utile!
Publier du code. Qu'y a-t-il dans LoginForm.main()? En attendant, cela pourrait aider: http://stackoverflow.com/questions/964566/vs-2008-addon-to-temporarily-disable-remove-all-catch-block/964579#964579 –
Un code source de la FirstLine .LoginForm.main() serait probablement utile :-). – bang