i have the following code :

static IScanningService scanningLayer = null;
		public static IScanningService BarcodeReader
		{
			get
			{
				if (scanningLayer == null)
				{
					string serviceName = GetServiceName();
					try
					{
						if (deviceService == null)
							deviceService = Assembly.Load(serviceName);
						object o = deviceService.CreateInstance(serviceName + ".BarcodeReader");
						scanningLayer = o as IScanningService;
						scanningLayer.AutoStartScan = Global.device.AutoStartScan;
						scanningLayer.PauseTime = Global.device.PauseTime;
						scanningLayer.ScanTime = Global.device.ScanTime;
					}
					catch (Exception ex)
					{
						if (ex.InnerException == null)
						{
							ErrorForm err = new ErrorForm();
							err.ShowDialog();
							//MessageBox.Show(ex.Message);
							
							//throw new ApplicationException(
							//   string.Format(Properties.Resources.FailedToLoad, serviceName), ex);
						}
						//throw ex;
					}
				}
				return scanningLayer;
			}
		}

for the first time in my life i see that after executing catch it comes back to try and starts infinite loop. Any explanation?

This question has already been answered. Start a new discussion instead.