Results 1 to 6 of 6
  1. #1
    Senior Member
    rikkimartin is offline

    Posts
    184

    Errors on publish

    When i run my program via visual studio debug mode it runs sweet no issues .

    once i publish as a release i get an error when running it

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Parameter is not valid.
    at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
    at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
    at Gunnery.Form1.SrnCannon4() in C:\Users\Rikki McGuire\Desktop\c# Projects\gunning\Gunnery\Gunnery\Form1.cs:line 552
    at Gunnery.Form1.TaskGetPixelC4() in C:\Users\Rikki McGuire\Desktop\c# Projects\gunning\Gunnery\Gunnery\Form1.cs:line 1084
    at System.Threading.Tasks.Task`1.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boo lean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task`1.GetResultCore(Boolea n waitCompletionNotification)
    at System.Threading.Tasks.Task`1.get_Result()
    at Gunnery.Form1.tmrCannon4_Tick_1(Object sender, EventArgs e) in C:\Users\Rikki McGuire\Desktop\c# Projects\gunning\Gunnery\Gunnery\Form1.cs:line 1132
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
    at System.Windows.Forms.Timer.TimerNativeWindow.WndPr oc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ---> (Inner Exception #0) System.ArgumentException: Parameter is not valid.
    at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
    at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
    at Gunnery.Form1.SrnCannon4() in C:\Users\Rikki McGuire\Desktop\c# Projects\gunning\Gunnery\Gunnery\Form1.cs:line 552
    at Gunnery.Form1.TaskGetPixelC4() in C:\Users\Rikki McGuire\Desktop\c# Projects\gunning\Gunnery\Gunnery\Form1.cs:line 1084
    at System.Threading.Tasks.Task`1.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()<---



    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18449 built by: FX451RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Gunnery
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Rikki%20McGuire/Desktop/c%23%20Projects/gunning/Gunnery/Gunnery/bin/Release/Gunnery.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    Skype: blazikin6

  2. #2
    Server Admin
    Sticky is offline

    Posts
    966
    Does you app using any image files? If so check if they're placed in the right directory.

  3. #3
    Senior Member
    rikkimartin is offline

    Posts
    184
    yeah uses image files, but they are in the right dir, when i use debug run on v/s it all works its only once i build the release version and use the executable
    Skype: blazikin6

  4. #4
    Senior Member
    TheRigger is offline

    Posts
    641
    Probably the stuff image files should be in the directory the executable is in?
    I dunno, that's how it works in java, and apparently C# is similar.

  5. #5
    Senior Member
    rikkimartin is offline

    Posts
    184
    wasnt the image files it was the screen returned a valuse of null

    my timer looks like this
    bool taskGot;
    try
    {
    Task<bool> taskGetPowder = new Task<bool>(TaskGetPowderC4);
    taskGetPowder.Start();
    Task.WaitAny(taskGetPowder);
    taskGot = taskGetPowder.Result;
    }
    catch (Exception ex)
    {
    if (ex.InnerException == null)
    throw ex;
    else
    throw ex.InnerException;


    }


    if (taskGot == true)
    {



    cannon = 4;
    MouseDragLeft();
    MouseDragRight();
    // i++;

    }

    now i get error

    System.ArgumentException was unhandled
    HResult=-2147024809
    Message=Parameter is not valid.
    Source=Gunnery
    StackTrace:
    at Gunnery.Form1.tmrCannon4_Tick_1(Object sender, EventArgs e)
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
    at System.Windows.Forms.Timer.TimerNativeWindow.WndPr oc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at Gunnery.Program.Main()
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
    at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException:





    }
    Skype: blazikin6

  6. #6
    Senior Member
    rikkimartin is offline

    Posts
    184
    Thread closed :P finally solved my issue
    Skype: blazikin6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •