locked
Weird Error RRS feed

  • Question

  • Hello,

    I have been having a very weird error lately:

    System.InvalidOperationException was unhandled

      Message=An error occurred creating the form. See Exception.InnerException for details.  The error is: Object reference not set to an instance of an object.

      Source=Tic-Tac-Toe Basic

      StackTrace:

           at Tic_Tac_Toe_Basic.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190

           at Tic_Tac_Toe_Basic.My.MyProject.MyForms.get_Form1()

           at Tic_Tac_Toe_Basic.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\Owner\My Documents\Visual Studio 2010\Projects\Tic-Tac-Toe Basic\Tic-Tac-Toe Basic\My Project\Application.Designer.vb:line 35

           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

           at Tic_Tac_Toe_Basic.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

           at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean ignoreSyncCtx)

           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

           at System.Threading.ThreadHelper.ThreadStart()

      InnerException: System.NullReferenceException

           Message=Object reference not set to an instance of an object.

           Source=Tic-Tac-Toe Basic

           StackTrace:

                at Tic_Tac_Toe_Basic.Form1..ctor() in C:\Documents and Settings\Owner\My Documents\Visual Studio 2010\Projects\Tic-Tac-Toe Basic\Tic-Tac-Toe Basic\Form1.vb:line 10

           InnerException: 

    I have never had this error until today. I installed the offline version of C# and Web Developer yesterday and am using the online install of VB.NET 2010, but I doubt that matters. I thought that the reason of this error was because of an option I turned on in C# called "Edit and continue" or something close to that. So I turned that off and I still get this error trying to debug any application that I built before I installed C# and Web Developer. I can still build them ok, but I need to be able to debug. Has anyone had this problem and found a solution. Anyone who wrote the VB.net or the C# applications know of any conflicts?

    Thanks, VisualBasic2010User

    Saturday, January 8, 2011 7:13 PM

Answers

  • Ok, i have solved this problem and for anyone else having this problem, Make Sure You Put a "New" identifier before a "Random" identifier

    Ex:

    Dim RND as Random ' NOT GOOD
    Dim RND as New Random ' GOOD

    Sunday, January 9, 2011 6:58 PM