SciChart 3.1 exception - scichart

A bit of a long-shot given that I'm using such an old version (3.1.0.4759). Users have recently started reporting the exception below when zooming on one of my application's charts. It's a bit of a pain as it can't be handled, so the whole app crashes.
It's very, very intermittent, and I've not been able to repro. The chart series does get cleared down and repopulated once a second, so the intermittent nature could be explained by (say) zooming at that specific moment in time. Having said this, I have a lot of charts throughout my app, many of which are continuously plotting, and all using the same chart modifiers, but have never noticed this problem before.
Just wondering if any of the ABT guys can shed any light on this! TIA.
System.NullReferenceException: Object reference not set to an instance of an object.
at Abt.Controls.SciChart.RangeFactory.NewWithMinMax(IRange originalRange, IComparable min, IComparable max)
at Abt.Controls.SciChart.Wpf.PcitureHelper.Zoom(IRange initialRange, Double fromCoord, Double toCoord)
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.UpdateOutline(IAxis firstFont, Double currentValues, Double currentId)
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.UpdateOutline(IAxis firstFont, Rect currentValues)
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.OpenDatabase(Point firstFont, Point currentValues)
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.OnModifierMouseUp(ModifierMouseArgs e)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.UpdateOutline(Action2 firstFont, ModifierEventArgsBase currentValues)
at Abt.Controls.SciChart.Common.Extensions.EnumerableExtensions.CopyBuilder[firstFont](IEnumerable`1 firstFont, Action1 currentValues)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.QueueInvoker.JoinControl(Object firstFont, MouseButtonEventArgs currentValues)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)

It looks like you got a NullReferenceException inside RangeFactory.NewWithMinMax
and also looks like you've customised the source-code, as the methods
at Abt.Controls.SciChart.Wpf.PcitureHelper.Zoom(IRange initialRange, Double fromCoord, Double toCoord)
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.UpdateOutline(IAxis firstFont, Double currentValues, Double currentId)
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.UpdateOutline(IAxis firstFont, Rect currentValues).
at Abt.Controls.SciChart.ChartModifiers.RubberBandXyZoomModifier.OpenDatabase
are not part of the SciChart codebase.
So I'd guess that the problem lies in those methods passing invalid values to RangeFactory.
BTW the SciChart team would also tell you that v3 is pretty out of date and to ensure stability, to get up to date. That and if you get problems like this in an old version, especially in customised source-code, they can't help!

Related

MVC - Index (zero based) must be greater than or equal to zero and less than the size of the argument list

I was following this Mohsen Esmailpour's answer, to build a sample project to load views and controllers from a class library using custom view engine.
Here's what I did,
Add a Asp.Net MVC project
Add a class library. Add references to
Microsoft.AspNet.Razor
Microsoft.AspNet.WebPages
Microsoft.Web.Infrastructure
Microsoft.AspNet.Mvc"
Reference class library in MVC project.
3. Add a "Controllers" folder and added "MyViewController.cs" class
public class MyViewController : Controller
{
public ActionResult Index()
{
return View();
}
}
View engine (which should be causing the problem), I am not entirely sure what's happening here,
public class CustomViewEngine : RazorViewEngine
{
public CustomViewEngine()
{
MasterLocationFormats = new string[]
{
"~/bin/Views/{1}/{0}.cshtml",
"~/bin/Views/Shared/{0}.cshtml"
};
ViewLocationFormats = new string[]
{
"~/bin/Areas/{2}/Views/{1}/{0}.cshtml",
"~/bin/Areas/{2}/Views/Shared/{0}.cshtml"
};
}
}
Route.config for the Mvc project,
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(name: "Route2", url: "{controller}/{action}/{id}",
namespaces: new[] { "Custom.Views.Controllers" },
defaults: new { controller = "MyView", action = "Index", id = UrlParameter.Optional });
}
}
Add Views folder and added "MyView.cshtml" (Views/MyView/Index.cshtml), also I set the Properties of this cshtml to "Copy to Output Directory" as "Copy Always" so that it appears in web project / bin/MyView/Index.cshtml.
When I run the project, http://localhost:/MyView, it hits the "MyView" controller, but not finding the "MyView" view.
Server Error in '/' Application.
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Index (zero based) must be
greater than or equal to zero and less than the size of the argument
list.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[FormatException: Index (zero based) must be greater than or equal to
zero and less than the size of the argument list.]
System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider,
String format, ParamsArray args) +1876
System.String.FormatHelper(IFormatProvider provider, String format,
ParamsArray args) +58 System.String.Format(IFormatProvider
provider, String format, Object[] args) +80
System.Web.Mvc.ViewLocation.Format(String viewName, String
controllerName, String areaName) +70
System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext
controllerContext, List1 locations, String name, String
controllerName, String areaName, String cacheKey, String[]&
searchedLocations) +166
System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext
controllerContext, String[] locations, String[] areaLocations, String
locationsPropertyName, String name, String controllerName, String
cacheKeyPrefix, Boolean useCache, String[]& searchedLocations) +626
System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext
controllerContext, String viewName, String masterName, Boolean
useCache) +130
System.Web.Mvc.<>c__DisplayClass14_0.<FindView>b__1(IViewEngine e) +24
System.Web.Mvc.ViewEngineCollection.Find(Func2 lookup, Boolean
trackSearchedPaths) +85
System.Web.Mvc.ViewEngineCollection.FindView(ControllerContext
controllerContext, String viewName, String masterName) +183
System.Web.Mvc.ViewResult.FindView(ControllerContext context) +84
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
+126 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext
controllerContext, ActionResult actionResult) +13
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) +56
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) +420
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext, IList1 filters, ActionResult actionResult) +52
System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__3()
+198 System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult
asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult
asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
asyncResult) +27
System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult
asyncResult, ExecuteCoreState innerState) +11
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +45
System.Web.Mvc.<>c.<BeginExecute>b__151_2(IAsyncResult asyncResult,
Controller controller) +13
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +22
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
asyncResult) +10
System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult
asyncResult, ProcessRequestState innerState) +28
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
+28 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+583 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously) +173
Seems like I am missing something.
not sure what ""~/bin/Views/{1}/{0}.cshtml" configurations doing and it seems failing in CustomViewEngine.
I had a typo in the folder's name, the folder in which my view was located.

SourceTree crashing when hitting commit

I am using SourceTree 1.8.3.0 (I Know this isn't the latest version, but that version immediately crashes when starting up) on Windows 10 64bit. SourceTree crashes when I want to commit, giving me the following error in the log file (sorry automatically translates to Dutch).
This is a 32 bit application but as I said the latest version (1.9.5.0) is even worse.
Does anyone have an idea what is wrong or where I can download a more stable version?
thanks in advance
System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
bij SourceTree.Accounts.AccountManager.GetDefaultUserInformation(String& fullname, String& email) in C:\projects\bitbucket.org\atlassian\sourcetreewin-prod\Accounts\AccountManager.cs:regel 114
bij SourceTree.ViewModel.UserDetailsViewModel..ctor(Repository repo, Action`2 completionAction, ICustomActionsManager customActionsManager, ISchedulerManager schedulerManager, IRepositoryManager repositoryManager, IAnalyticsDataManager analyticsDataManager, ITraceManager traceManager, IDispatcher sourceTreeDispatcher, IAccountManager accountManager, IFailureHandler failureHandler, IDvcsManager dvcsManager, IRepositoryMonitorManager repositoryMonitorManager, IFileListViewManager fileListViewManager, IFileListContainerViewManager fileListContainerViewManager, IDiffViewManager diffViewManager, IConfigurationManager configurationManager, IProcessDialogViewManager processDialogViewManager, IChangeSetViewManager changeSetViewManager) in C:\projects\bitbucket.org\atlassian\sourcetreewin-prod\SourceTree.Api.UI.Wpf\ViewModel\UserDetailsViewModel.cs:regel 61
bij SourceTree.ViewModel.CommitAndFileStatusViewModel._CheckMinimumRequirementsBeforeEnterCommit() in C:\projects\bitbucket.org\atlassian\sourcetreewin-prod\SourceTree.Api.UI.Wpf\ViewModel\CommitAndFileStatusViewModel.cs:regel 719
bij SourceTree.ViewModel.CommitAndFileStatusViewModel.EnterCommitMode() in C:\projects\bitbucket.org\atlassian\sourcetreewin-prod\SourceTree.Api.UI.Wpf\ViewModel\CommitAndFileStatusViewModel.cs:regel 611
bij System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bij System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bij System.Windows.FrameworkElement.OnGotFocus(RoutedEventArgs e)
bij System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
bij System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bij System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bij System.Windows.Controls.TextBox.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bij System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
bij System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
bij System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
bij System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)
bij System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
bij System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bij System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bij System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
bij System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
bij System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
bij System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
bij System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
bij System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
bij System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bij System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bij System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bij System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bij System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bij System.Windows.Input.InputManager.ProcessStagingArea()
bij System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
bij System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
bij System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
bij System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
bij System.Windows.UIElement.Focus()
bij System.Windows.Documents.TextEditorMouse.MoveFocusToUiScope(TextEditor This)
bij System.Windows.Documents.TextEditorMouse.OnMouseDown(Object sender, MouseButtonEventArgs e)
bij System.Windows.Controls.Primitives.TextBoxBase.OnMouseDown(MouseButtonEventArgs e)
bij System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
bij System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bij System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bij System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bij System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bij System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bij System.Windows.Input.InputManager.ProcessStagingArea()
bij System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
bij System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
bij System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bij System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bij MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bij MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
The same behavior occurs with version 3.2.6. When pressing the Commit button sourcetree crashes. The problem could be solved by deactivating the global user settings.
Please excuse the German language setting.

Windows Phone NullReferenceException while navigating mystery

During page navigatin within my app I display a message in the system tray to the user along with the progress bar to indicate something is going on.
The problem I'm having is during debug I am randomly getting the following error:
{System.NullReferenceException: Object reference not set to an instance of an object.
at ContosoSocial.SetProgressIndicator.<>c__DisplayClass1.<runSystrayMessage>b__0(Object sender, EventArgs args)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)} System.Exception {System.NullReferenceException}
Stacktrace:
StackTrace " at ContosoSocial.SetProgressIndicator.<>c__DisplayClass1.<runSystrayMessage>b__0(Object sender, EventArgs args)\r\n at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)\r\n at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)" string
I'm still new to VS2013 and Windows Phone programming so really need a little help here figuring out how to trace and fix this problem?
The error seems to be random, here is an example of the class displaying the system tray message and calling method:
class SetProgressIndicator
{
public void runSystrayMessage(bool isVisible, string text, int length)
{
try
{
SystemTray.ProgressIndicator = new ProgressIndicator();
SystemTray.ProgressIndicator.IsVisible = true;
SystemTray.ProgressIndicator.Text = text;
SystemTray.ProgressIndicator.IsIndeterminate = isVisible;
}
catch (System.InvalidOperationException e)
{
Debug.WriteLine("Exception caught in runSystrayMessage(): \r\n" + e);
}
DispatcherTimer timer = new DispatcherTimer();
try
{
timer.Interval = TimeSpan.FromMilliseconds(length);
}
catch(ArgumentOutOfRangeException e)
{
Debug.WriteLine("Exception caught in runSystrayMessage(): \r\n" + e);
}
timer.Tick += (sender, args) =>
{
try
{
SystemTray.ProgressIndicator.IsVisible = false;
}
catch(System.InvalidOperationException e)
{
Debug.WriteLine("Exception caught in runSystrayMessage(): \r\n" + e);
}
timer.Stop();
};
timer.Start();
}
}
}
Example of a calling method:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
SetProgressIndicator progInd = new SetProgressIndicator();
// Check for full licnece before removing ad's
if (TrialExperienceHelper.LicenseMode == TrialExperienceHelper.LicenseModes.Full)
{
GOTPubCenter10.Visibility = Visibility.Collapsed;
}
// Dispaly message in system tray
if (hasBeenVisited)
{
progInd.runSystrayMessage(true, "Entering house selection menu...", 2500);
}
else
{
progInd.runSystrayMessage(true, "Select house library to enter...", 8000);
hasBeenVisited = true;
}
}
Ideas and suggestions on how to solve the problem appreciated.

MySqlDataReader.Read() throws ArgumentOutOfRangeException

I'm working with mysql .net connector 6.4.4 at win7 x64 platform. While reading data from MySqlDataReader Object, it throws exception after 18th row. But in another application I could take 40 rows without errors.
The error is just here:
MySqlDataReader.Read()
Any helps would be very appreciated.
Exception details:
System.ArgumentOutOfRangeException was unhandled
Message=Non-negative number required.
Parameter name: count
Source=mscorlib
ParamName=count
StackTrace:
at System.IO.MemoryStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlPacket.Read(Byte[] byteBuffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlPacket.ReadString(Int64 length)
at MySql.Data.Types.MySqlString.MySql.Data.Types.IMySqlValue.ReadValue(MySqlPacket packet, Int64 length, Boolean nullVal)
at MySql.Data.MySqlClient.NativeDriver.ReadColumnValue(Int32 index, MySqlField field, IMySqlValue valObject)
at MySql.Data.MySqlClient.Driver.ReadColumnValue(Int32 index, MySqlField field, IMySqlValue value)
at MySql.Data.MySqlClient.ResultSet.ReadColumnData(Boolean outputParms)
at MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlDataReader.Read()
at VeriTasima.Form1..ctor() in E:\Projeler\VeriTasima\VeriTasima\Form1.cs:line 42
at VeriTasima.Program.Main() in E:\Projeler\VeriTasima\VeriTasima\Program.cs:line 18
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:
Updated:
// test
string commandString = "SELECT * FROM haber LIMIT 50";
MySqlConnection connection = new MySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);
MySqlCommand command = new MySqlCommand(commandString, connection);
connection.Open();
MySqlDataReader sdr = command.ExecuteReader();
int count = 0;
while (sdr.Read())
{
count++;
}
sdr.Close();
sdr.Dispose();
command.Dispose();
connection.Close();
connection.Dispose();
MessageBox.Show(count.ToString());
Updated:
I fixed this problem by setting target platfrom from x86 to Any CPU. Now works properly.

WinForms ReportViewer cannot connecto to remote Report Server (SQL Express)

Introduction:
I have SQL Server Express 2008 R2 installed with Advanced Services. I have created few reports using BI Design Studio and deployed them to the Server. If I access the reporting server using IE (http://Ser2008/Reports/) it works fine (I have to put in User Name/Password). I can view reports or fool around with the settings.
Problem:
On my local machine I created a winforms application with one form containing a ReportViewer control. On form load I'm running following code:
reportViewer1.ProcessingMode = ProcessingMode.Remote;
reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials =
new CustomCredentials("secret#123") {
UserName = "administrator",
Domain = "ser2008"
}.NetworkCredentials;
reportViewer1.ServerReport.ReportServerUrl = new Uri("http://ser2008/Reports/");
reportViewer1.ServerReport.ReportPath = "/Students/Attendance";
var l = new List<ReportParameter>();
l.Add(CreateParameter("UserId", "144"));
l.Add(CreateParameter("Class", "8"));
l.Add(CreateParameter("date_from", "2011-09-04"));
l.Add(CreateParameter("date_to", "2011-12-31"));
reportViewer1.ServerReport.SetParameters(l); //EXCEPTION THROWN HERE
reportViewer1.RefreshReport();
I get following exception:
The attempt to connect to the report server failed. Check your connection
information and that the report server is a compatible version. The request
failed with HTTP status 404: Not Found.
The stack trace is as follows:
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005
.Execution.RSExecutionConnection.MissingEndpointException
.ThrowIfEndpointMissing(WebException e)
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005
.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn]
(RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.
Execution.RSExecutionConnection.LogonUser(String userName, String password, String authority)
at Microsoft.Reporting.WinForms.ServerReport.get_Service()
at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
at GridEditor.ReportViewerForm.btnRefresh_Click(Object sender, EventArgs e)
in D:\TestApp\ReportViewerForm.cs:line 79
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager
.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at GridEditor.Program.Main() in D:\TestApp\Program.cs:line 16
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()
CustomCredentials:
public class CustomCredentials : IReportServerCredentials
{
public string UserName { get; set; }
public SecureString Password { get; set; }
public string Domain { get; set; }
#region ctor
public CustomCredentials(string password)
{
Password = new SecureString();
foreach (char c in password.ToCharArray())
Password.AppendChar(c);
}
#endregion
#region IReportServerCredentials Members
public bool GetFormsCredentials(out Cookie authCookie, out string userName
, out string password, out string authority)
{
throw new NotImplementedException();
}
public System.Security.Principal.WindowsIdentity ImpersonationUser
{
get { throw new NotImplementedException(); }
}
public System.Net.ICredentials NetworkCredentials
{
get { return new NetworkCredential(UserName, Password, Domain); }
}
#endregion
}
UPDATE:
I have found following exception also in some place in my log file:
System.Web.Services.Protocols.SoapException: The path of the item
'/Students/Attendance/_vti_bin/ListData.svc/$metadata' is not valid. The full
path must be less than 260 characters long; other restrictions apply. If the
report server is in native mode, the path must start with slash. --->
Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException:
The path of the item '/Students/Attendance/_vti_bin/ListData.svc/$metadata' is
not valid. The full path must be less than 260 characters long; other
restrictions apply. If the report server is in native mode, the path must
start with slash.
at Microsoft.ReportingServices.WebServer.ReportingService2005Impl
.GetPermissions(String Item, String[]& Permissions)
In the end it was all trivial detail 8-)
I was using Report Manager url (http://ser2008/Reports/) where I was to use Report Server url (http://ser2008/ReportServerXp/).
Well, you should implement IReportServerCredential, and code example as follow :
public class CustomReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials
{
// local variable for network credential.
private string _UserName;
private string _PassWord;
private string _DomainName;
public CustomReportCredentials(string UserName, string PassWord, string DomainName)
{
_UserName = UserName;
_PassWord = PassWord;
_DomainName = DomainName;
}
public WindowsIdentity ImpersonationUser
{
get
{
return null; // not use ImpersonationUser
}
}
public ICredentials NetworkCredentials
{
get
{
// use NetworkCredentials
return new NetworkCredential(_UserName,_PassWord,_DomainName);
}
}
public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)
{
// not use FormsCredentials unless you have implements a custom autentication.
authCookie = null;
user = password = authority = null;
return false;
}
}
then use this as follows:
IReportServerCredentials irsc = new CustomReportCredentials(userid,password, domain);
ReportViewer1.ServerReport.ReportServerCredentials = irsc;
the other code to set ServerReport property omit. hope you have a good day.