Xamarin Forms iOS switch renderer null reference exception - xamarin

I have a xamarin forms switch , when it is toggled getting the following exception on ios version only:
{System.NullReferenceException: Object reference not set to an instance of an object
at Xamarin.Forms.Platform.iOS.SwitchRenderer.OnElementToggled (System.Object sender, System.EventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\SwitchRenderer.cs:78
at (wrapper delegate-invoke) System.EventHandler`1[Xamarin.Forms.ToggledEventArgs].invoke_void_object_TEventArgs(object,Xamarin.Forms.ToggledEventArgs)
at Xamarin.Forms.Switch+<>c.<.cctor>b__21_0 (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Switch.cs:14
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:343
at Xamarin.Forms.Element.SetValueFromRenderer (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:250
at Xamarin.Forms.Element.Xamarin.Forms.IElementController.SetValueFromRenderer (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:246
at Xamarin.Forms.Platform.iOS.SwitchRenderer.OnControlValueChanged (System.Object sender, System.EventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\SwitchRenderer.cs:73
at UIKit.UIControlEventProxy.Activated () [0x00004] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIControl.cs:38
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at WeCareMobility.iOS.Application.Main (System.String[] args) [0x00002] in /Users/user/Desktop/Vipin/Copiloto/Mobile/WeCareMobility/WeCareMobility.iOS/Main.cs:20 }
Xaml:
<Switch Grid.Row="0" Grid.Column="1" Margin="{OnPlatform Android='0,0,25,0',iOS='0,0,0,8'}" Scale="{OnPlatform iOS= '0.7'}" VerticalOptions="Start" HorizontalOptions="FillAndExpand" IsToggled="False" Toggled="Switch_Toggled" />
CS:
private void Switch_Toggled(object sender, ToggledEventArgs e)
{
// Perform an action after examining e.Value
if (e.Value)
{
App.Current.MainPage = new NavigationPage(new FlyoutPage());
_weCareStorageService.SetToggleValue(true);
}
}
I do not have any renderer for switch. It is working fine for android.
Upgraded to latest xamarin forms stable version 4.7.0.1080.
Using VS2019 mac. iOS sdk version:13.18.2.1 .
Cleaned,rebuilt. Still crash occurs in ios. Need some help...

Navigation was the issue.Changed navigation like this:
Device.BeginInvokeOnMainThread(() => { App.Current.MainPage = new NavigationPage(new FlyoutPage()); });
Solved issue.

Related

Internet Service Error on Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime on dot net 6

i attempt to migrate bot framework composer dot net 3.1 project to dot net 6
upon testing i hit Internet Service Error, any insight would be appreciated.
ArgumentNullException: Value cannot be null. (Parameter 'adaptiveDialogId')
Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialogBot..ctor(string adaptiveDialogId, string languageGeneratorId, ResourceExplorer resourceExplorer, ConversationState conversationState, UserState userState, SkillConversationIdFactoryBase skillConversationIdFactoryBase, LanguagePolicy languagePolicy, BotFrameworkAuthentication botFrameworkAuthentication, IBotTelemetryClient telemetryClient, IEnumerable scopes, IEnumerable pathResolvers, IEnumerable dialogs, ILogger logger)
Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.ConfigurationAdaptiveDialogBot..ctor(IConfiguration configuration, ResourceExplorer resourceExplorer, ConversationState conversationState, UserState userState, SkillConversationIdFactoryBase skillConversationIdFactoryBase, LanguagePolicy languagePolicy, BotFrameworkAuthentication botFrameworkAuthentication, IBotTelemetryClient telemetryClient, IEnumerable scopes, IEnumerable pathResolvers, IEnumerable dialogs, ILogger logger)
System.RuntimeMethodHandle.InvokeMethod(object target, ref Span arguments, Signature sig, bool constructor, bool wrapExceptions)
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)
lambda_method8(Closure , IServiceProvider , object[] )
Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider+<>c__DisplayClass7_0.b__0(ControllerContext controllerContext)
Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider+<>c__DisplayClass6_0.g__CreateController|0(ControllerContext controllerContext)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Thanks AP01 for dropping your knowledge
Unfortunately, the adaptiveDialogId is embedded in library Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime in which I cannot debug
however, inspired by your advice
I modify the build target not from scratch, but simply upgrade the dot net target straight from 3.1 to 6
as it turns out the problems caused by nullable validation in the Project File, this causes dot net 3.1 libraries not working
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Platforms>x64</Platforms>
**<Nullable>enable</Nullable>**
...
</PropertyGroup>

SQLite app gives AccessViolation on new SQLiteConnection Windows 10 v 20H2

Sqlite crashes on SqliteConnecion
I have an application that uses Sqlite. I has been working perfectly for a couple of year.
I'm using Nuget System.Data.SQLite.Core 1.0.113.7
I tried to run it and i get this exception.
System.AccessViolationException HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. Source= StackTrace:
The exception occurs in the
public static string DbFile
{
get { return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Foo\\Bar" + "\\Order.db"; }
}
public static SQLiteConnection OrderDbConnection()
{
try
{
var db = $"Data Source={DbFile};Version=3;";
return new SQLiteConnection(db);
}
catch (Exception ex)
{
var m = ex.Message;
throw;
}
}
on the line return new SQLiteConnection(db);
I'm using
Visual Studio 2017 version 15.9.35
.NET Framework 4.7.2
Edition Windows 10 Pro
Version 20H2
Installed on ‎2020-‎11-‎05
OS build 19042.928
Experience Windows Feature Experience Pack 120.2212.551.0
I just tried the application on windows 10 version 1909 and there it works!
Has anyone any idea on what could be wrong?
EDIT: Add Exception from Event Viewer
Application: DCMatrix.exe Framework Version: v4.0.30319 Description:
The process was terminated due to an unhandled exception. Exception
Info: System.AccessViolationException at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(System.Data.SQLite.SQLiteConfigOpsEnum)
at System.Data.SQLite.SQLite3.StaticIsInitialized() at
System.Data.SQLite.SQLiteLog.Initialize(System.String) at
System.Data.SQLite.SQLiteConnection..ctor(System.String, Boolean)
at System.Data.SQLite.SQLiteConnection..ctor(System.String) at
AbortedOrderDatabase.SqLiteBaseRepository.OrderDbConnection() at
AbortedOrderDatabase.SqLiteOrderRepository.IsOrderDone(System.String)
at DCMatrix.Workflow.IsOrderDone(System.String) at
DCMatrix.Workflow.GetOrder(System.String, Boolean ByRef, Boolean
ByRef) at DCMatrix.ViewMainWindow.DoLoadDataCommand() at
DCMatrix.ViewMainWindow.<get_LoadDataCommand>b__21_1(System.Object)
at DCMatrix.RelayCommand.Execute(System.Object) at
System.Windows.Input.CommandManager.TranslateInput(System.Windows.IInputElement,
System.Windows.Input.InputEventArgs) at
System.Windows.UIElement.OnKeyDownThunk(System.Object,
System.Windows.Input.KeyEventArgs) at
System.Windows.Input.KeyEventArgs.InvokeEventHandler(System.Delegate,
System.Object) at
System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate,
System.Object) at
System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object,
System.Windows.RoutedEventArgs) at
System.Windows.EventRoute.InvokeHandlersImpl(System.Object,
System.Windows.RoutedEventArgs, Boolean) at
System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject,
System.Windows.RoutedEventArgs) at
System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs,
Boolean) at System.Windows.Input.InputManager.ProcessStagingArea()
at
System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at
System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at
System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr,
System.Windows.Input.InputMode, Int32,
System.Windows.Input.RawKeyboardActions, Int32, Boolean, Boolean,
Int32) at
System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(System.Windows.Interop.MSG
ByRef, Boolean ByRef) at
System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(System.Windows.Interop.MSG
ByRef, System.Windows.Input.ModifierKeys) at
System.Windows.Interop.HwndSource.OnPreprocessMessage(System.Object)
at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,
System.Object, Int32) at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,
System.Delegate, System.Object, Int32, System.Delegate) at
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,
System.TimeSpan, System.Delegate, System.Object, Int32) at
System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority,
System.Delegate, System.Object) at
System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(System.Windows.Interop.MSG
ByRef, Boolean ByRef) at
System.Windows.Interop.HwndSource+WeakEventPreprocessMessage.OnPreprocessMessage(System.Windows.Interop.MSG
ByRef, Boolean ByRef) at
System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG
ByRef) at
System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at
System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object) at
System.Windows.Application.RunInternal(System.Windows.Window) at
System.Windows.Application.Run(System.Windows.Window) at
System.Windows.Application.Run() at DCMatrix.App.Main()
EDIT 2 Exception and Stack Trace
System.AccessViolationException HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. Source= StackTrace:
" at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum
op) at System.Data.SQLite.SQLite3.StaticIsInitialized() at
System.Data.SQLite.SQLiteLog.Initialize(String className) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString,
Boolean parseViaFramework) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at AbortedOrderDatabase.SqLiteBaseRepository.OrderDbConnection() in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\OrderDatabase\SqLiteBaseRepository.cs:line 23"
EDIT 3 Enabled Native Code Debugging
Exception thrown at 0x776388E3 (ntdll.dll) in DCMatrix.exe:
0xC0000005: Access violation writing location 0x0044005C. occurred
System.AccessViolationException HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. Source= StackTrace:
" at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum
op) at System.Data.SQLite.SQLite3.StaticIsInitialized() at
System.Data.SQLite.SQLiteLog.Initialize(String className) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString,
Boolean parseViaFramework) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at AbortedOrderDatabase.SqLiteBaseRepository.OrderDbConnection() in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\OrderDatabase\SqLiteBaseRepository.cs:line 23 at
AbortedOrderDatabase.SqLiteOrderRepository.IsOrderDone(String mo) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\OrderDatabase\SqLiteOrderRepository.cs:line 57 at
DCMatrix.Workflow.IsOrderDone(String mo) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\Workflow.cs:line 977 at
DCMatrix.Workflow.GetOrder(String tvnr, Boolean& isAbortedOrder,
Boolean& isOrderDone) in E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\Workflow.cs:line 920 at
DCMatrix.ViewMainWindow.DoLoadDataCommand() in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\CommandMainWindow.cs:line 244 at
DCMatrix.ViewMainWindow.<get_LoadDataCommand>b__21_1(Object p) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\CommandMainWindow.cs:line 122 at
DCMatrix.RelayCommand.Execute(Object parameter) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\RelayCommand.cs:line 34 at
System.Windows.Input.CommandManager.TranslateInput(IInputElement
targetElement, InputEventArgs inputEventArgs) at
System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget) 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.UIElement.RaiseEvent(RoutedEventArgs args, Boolean
trusted) 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.HwndKeyboardInputProvider.ReportInput(IntPtr
hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions,
Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32
virtualKey) at
System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG&
msg, Boolean& handled) at
System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG&
msg, ModifierKeys modifiers) at
System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
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
System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority
priority, Delegate method, Object arg) at
System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg,
Boolean& handled) at
System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG&
msg, Boolean& handled) at
System.Windows.Interop.ThreadMessageEventHandler.Invoke(MSG& msg,
Boolean& handled) at
System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG&
msg) at
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame
frame) at
System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore) at
System.Windows.Application.RunInternal(Window window) at
System.Windows.Application.Run(Window window) at
System.Windows.Application.Run() at DCMatrix.App.Main()"

EMDK for xamarin

I am using EMDK for xamarin in an Xamarain.Android app. I am getting this error:
Unable to activate instance of type Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor from native handle 0x1d200001 (key_handle 0x426eae90).
This error occurs randomly.
Find below the detailed logs. Please help in resolving this issue
System.NotSupportedException: Unable to activate instance of type Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor from native handle 0x1d200001 (key_handle 0x41b8ad20). ---> System.MissingMethodException: No constructor found for Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
at Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
at --- End of managed Java.Lang.Error stack trace ---
at java.lang.Error: Java callstack:
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.n_onStatus(Native Method)
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.onStatus(Scanner_StatusListenerImplementor.java:30)
at at com.symbol.emdk.barcode.StatusCallbackInternal$StatusCallbackThread.run(StatusCallbackInternal.java:73)
at --- End of managed Java.Lang.Error stack trace ---
at java.lang.Error: Java callstack:
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.n_onStatus(Native Method)
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.onStatus(Scanner_StatusListenerImplementor.java:30)
at at com.symbol.emdk.barcode.StatusCallbackInternal$StatusCallbackThread.run(StatusCallbackInternal.java:73)
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) [0x00058] in <filename unknown>:0
at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x00138] in <filename unknown>:0
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x001b0] in <filename unknown>:0
at Java.Lang.Object.GetObject (IntPtr handle, JniHandleOwnership transfer, System.Type type) [0x000e5] in <filename unknown>:0
at Java.Lang.Object._GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x0001a] in <filename unknown>:0
at Java.Lang.Object.GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x00000] in <filename unknown>:0
at Java.Lang.Object.GetObject[T] (IntPtr jnienv, IntPtr handle, JniHandleOwnership transfer) [0x00006] in <filename unknown>:0
at Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerInvoker.n_OnStatus_Lcom_symbol_emdk_barcode_StatusData_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) [0x00000] in <filename unknown>:0
at at (wrapper dynamic-method) System.Object:043283ed-110f-43b7-811b-51b1dfa39e65 (intptr,intptr,intptr)
Just adding this in case someone may stumble onto it in the future
Not sure why are you getting that error, but here's a code sample that works without having to add an implementation of the IStatusListenerImplementor interface.
private void SetupEmdkBarcodeScanner
{
var emdkBarcodeManager = (Symbol.XamarinEMDK.Barcode.BarcodeManager)emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode);
var emdkBarcodeScanner = emdkBarcodeManager.GetDevice(BarcodeManager.DeviceIdentifier.Default);
if(emdkBarcodeScanner.IsReadPending)
{
emdkBarcodeScanner.CancelRead();
}
emdkBarcodeScanner.Data += HandleReadEvent;
emdkBarcodeScanner.Status += HandleStatusEvent;
}
private void HandleStatusEvent(object sender, Scanner.StatusEventArgs e)
{
if (e.P0.State != StatusData.ScannerStates.Idle)
{
return;
}
lock (concurrentReadsLock)
{
Thread.Sleep(100);
if (scanner.IsReadPending)
{
return;
}
emdkBarcodeScanner.Read();
}
}
private void HandleReadEvent(object sender, Scanner.DataEventArgs e)
{
if (e.P0.Result != ScannerResults.Success)
{
return
}
foreach (ScanDataCollection.ScanData data in e.P0.GetScanData())
{
string aimBarcodeData = data.Data; //here is your scanned barcode (e.g.: "]E00123456789123"
//... your barcode processing code goes here //
}
}
Also, don't forget to dispose at the end:
emdkBarcodeScanner.CancelRead();
emdkBarcodeScanner.Disable();
//.. unsubscribe the event handlers
emdkBarcodeScanner.Dispose();
//...and finally release the EMDK to remove your application's exclusive access.
emdkBarcodeManager.Release(EMDKManager.FEATURE_TYPE.Barcode);

Release Management for Visual Studio 2013 - Error When Selecting New Release

Getting an exception when selecting a Release Template and choosing "New Release" on "Configure Apps" tab of RM for Visual Studio 2013 Client.
After clicking "New Release" a pop-up appears in the lower right corner of the screen with "Unhandled Exception" and red stop sign. Looking through Event Viewer, below is the stack trace.
Anyone else encountering the same error?
The only step in the Release Template is to copy files to a DEV server on the same subnet.
Message: The remote server returned an error: (500) Internal Server Error.: \r\n\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.PlatformHttpClient.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndPost(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.HttpRequestor.<>c__DisplayClass1.<GetPostCaller>b__0(String url, String body)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseDeploymentControllerServiceProxy.PopulateTaggedActivities(String workflowXml, Int32 environmentId)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BuildReleaseStages(ReleasePath selectedReleasePath, XElement applicationVersion)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BringDataFromApplicationVersion()
at Microsoft.TeamFoundation.Release.Data.Model.Release.OnPropertyChanged(String propertyName, Boolean setDirty)
at Microsoft.TeamFoundation.Release.Data.Model.PropertyChangedBase.OnPropertyChanged(String propertyName)
at Microsoft.TeamFoundation.Release.Data.Model.Release.set_ApplicationVersionId(Int32 value)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel.Initialize(Int32 modelId)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel..ctor(String viewMode, Dictionary`2 popupParameters)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateNewRelease(Int32 releaseTemplateId)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateRelease(XElement selectedItem)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateNewRelease(Object selectedItems)
at Microsoft.VisualStudio.Release.ViewModel.Helpers.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
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.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
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.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Category: General
Priority: -1
EventId: 0
Severity: Error
Issue was permissions related. Fixed by adding AD computer name in Release Management server users.

Why is Serilog(.Extras.)Web's ApplicationLifecycleModule.Init() called twice?

I'm hosting a Web API in IIS (7.5) as an Application under "Default Web Site", and am using several of the Enrichers from Serilog.Extras.Web (I'll be upgrading soon to the SerilogWeb.Classic package). I noticed in my logs that ApplicationLifecycleModule.LogRequest() was being called twice for each request, and I'm trying to understand why.
What I noticed is that ApplicationLifecycleModule.Init() is being called twice, thus registering two event handlers.
The first callstack:
Serilog.Extras.Web.dll!Serilog.Extras.Web.ApplicationLifecycleModule.Init(System.Web.HttpApplication context)
System.Web.dll!System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(System.IntPtr appContext, System.Web.HttpContext context, System.Reflection.MethodInfo[] handlers)
System.Web.dll!System.Web.HttpApplication.InitSpecial(System.Web.HttpApplicationState state, System.Reflection.MethodInfo[] handlers, System.IntPtr appContext, System.Web.HttpContext context)
System.Web.dll!System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(System.IntPtr appContext, System.Web.HttpContext context)
System.Web.dll!System.Web.Hosting.PipelineRuntime.InitializeApplication(System.IntPtr appContext)
[AppDomain Transition]
And the second:
Serilog.Extras.Web.dll!Serilog.Extras.Web.ApplicationLifecycleModule.Init(System.Web.HttpApplication context)
System.Web.dll!System.Web.HttpApplication.InitModulesCommon()
System.Web.dll!System.Web.HttpApplication.InitInternal(System.Web.HttpContext context, System.Web.HttpApplicationState state, System.Reflection.MethodInfo[] handlers)
System.Web.dll!System.Web.HttpApplicationFactory.GetNormalApplicationInstance(System.Web.HttpContext context)
System.Web.dll!System.Web.HttpApplicationFactory.GetApplicationInstance(System.Web.HttpContext context)
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context)
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags)
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags)
Am I doing something wrong? Or is this a bug in the ApplicationLifecycleModule?

Resources