Null Reference Exception in Media.cs dotnet client

I get an unhandled exception every morning when I come in. I’ve been running a test campaign on a couple of displays, and they both had the same error this morning. It references line 232 in Media.cs. I’ll make sure to post the actual exception text here when it happens again.

I cloned the source code to my desktop to investigate, but the exception seems to take place inside an event handler for the media class. I wasn’t able to track down the cause.

The layout that seems to cause the issue includes a webpage using manual position, two text regions, one .mp4 video, and one .wmv video. The other layouts reuse some of the same regions with the addition of two embedded YouTube videos.

Here’s the log I pulled for the device:

29753   2016-03-08 07:53:51 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29752   2016-03-08 07:53:51 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29751   2016-03-08 07:05:11 Client  [UI Thread] WebMedia    Retrived the resource, stored the document but the media has already expired.
29750   2016-03-08 07:05:11 Client  [UI Thread] xmds_GetResource    Unable to get Resource: Requested an invalid file.
29749   2016-03-08 07:05:11 Client  [UI Thread] WebMedia    Retrived the resource, stored the document but the media has already expired.
29748   2016-03-08 06:52:55 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29747   2016-03-08 06:52:55 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29746   2016-03-08 06:34:40 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29745   2016-03-08 06:34:40 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29744   2016-03-08 06:23:30 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\13.xlf failed. Exception raised was: Collection was modified; enumeration operation may not execute.
29743   2016-03-08 06:23:30 Client  [UI Thread] MainForm - ChangeToNextLayout   Destroy Layout Failed. Exception raised was: Collection was modified; enumeration operation may not execute.
29742   2016-03-08 04:26:08 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29741   2016-03-08 04:26:08 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29740   2016-03-08 04:08:32 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29739   2016-03-08 04:08:32 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29738   2016-03-08 03:44:36 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\20.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\20.xlf' because it is being used by another process.
29737   2016-03-08 03:44:36 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\20.xlf' because it is being used by another process.
29736   2016-03-08 03:34:01 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29735   2016-03-08 03:34:01 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29734   2016-03-08 03:23:10 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29733   2016-03-08 03:23:10 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29699   2016-03-08 03:04:14 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29698   2016-03-08 03:04:14 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29697   2016-03-08 02:34:03 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29696   2016-03-08 02:34:03 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29695   2016-03-08 02:14:49 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29694   2016-03-08 02:14:49 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29693   2016-03-08 01:52:43 Client  [UI Thread] xmds_GetResource    Unable to get Resource: Requested an invalid file.
29692   2016-03-08 01:52:31 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29691   2016-03-08 01:52:31 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29690   2016-03-08 01:42:27 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29689   2016-03-08 01:42:27 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29688   2016-03-08 01:38:25 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29687   2016-03-08 01:38:25 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29686   2016-03-08 01:18:18 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29685   2016-03-08 01:18:18 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29684   2016-03-08 01:04:09 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29683   2016-03-08 01:04:09 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29682   2016-03-08 00:47:51 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29662   2016-03-08 00:47:51 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29661   2016-03-08 00:43:48 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29660   2016-03-08 00:43:48 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29659   2016-03-08 00:29:42 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29658   2016-03-08 00:29:42 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29657   2016-03-08 00:13:34 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29656   2016-03-08 00:13:34 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29655   2016-03-08 00:09:32 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29654   2016-03-08 00:09:32 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29653   2016-03-07 23:49:14 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\16.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29652   2016-03-07 23:49:14 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\16.xlf' because it is being used by another process.
29651   2016-03-07 20:01:44 Client  [ScheduleAgentThread] ScheduleAgent - Run   WebException in Run: Unable to connect to the remote server
29650   2016-03-07 20:01:27 Client  [LogAgent] LogAgent - Run   WebException in Run: Unable to connect to the remote server
29649   2016-03-07 20:01:17 Client  [RegisterAgentThread] RegisterAgent - Run   WebException in Run: Unable to connect to the remote server
29648   2016-03-07 20:01:17 Client  [RegisterAgentThread] RegisterAgent - Run   WebException in Run: Unable to connect to the remote server
29647   2016-03-07 18:28:15 Client  [UI Thread] MainForm - ChangeToNextLayout   Layout Change to C:\Users\oscmedia\Documents\Xibo Library\13.xlf failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\13.xlf' because it is being used by another process.
29646   2016-03-07 18:28:15 Client  [UI Thread] MainForm - ChangeToNextLayout   Prepare Layout Failed. Exception raised was: The process cannot access the file 'C:\Users\oscmedia\Documents\Xibo Library\13.xlf' because it is being used by another process.

Without the exception itself it’s hard to say. It should have been logged to the Windows event log so you can get it from there?

Generally it’s either missing updates to the .net framework or bad graphics drivers (especially if they’re Intel based) so it’s worth checking those are all up to scratch first. That said it seems pretty specific so there’s a good chance it’s our bug rather than something in the framework.

If the layout reproducibly causes that can you export it, upload it to Google Drive/Dropbox etc and PM me a link and we’ll take a look.

I’m looking at the Windows event log and I don’t see an entry for it. I’m looking under Windows Logs -> Application. I also looked in all the other logs just in case.

I did find some old application errors on the other test machine:

Faulting application name: XiboClient.exe, version: 2.0.0.0, time stamp: 0x5620b816
Faulting module name: igdumdim32.dll, version: 10.18.10.4252, time stamp: 0x55a0652e
Exception code: 0xc0000005
Fault offset: 0x001cd206
Faulting process id: 0x151c
Faulting application start time: 0x01d175f968d17d40
Faulting application path: C:\Program Files\Xibo Player\XiboClient.exe
Faulting module path: C:\WINDOWS\SYSTEM32\igdumdim32.dll
Report Id: 8ae3bad8-8587-433f-bdb6-d36497bb5de4
Faulting package full name: 
Faulting package-relative application ID: 

and:

Application: XiboClient.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005, exception address 538CD206

However, I don’t know if these are related to my issue.

FYI:
The displays are powered by a Lenovo PC Stick running Windows 10 Home edition

That’s the Intel graphics driver. We’ve seen lots of crashes from that previously and they’re generally cured by updating the drivers to the latest available download from Intel, so I’d give that a go. If you can send over the layout that triggers this please we can certainly look at the other issue

I couldn’t figure out how to send a PM so here’s the [link][2]
[2]: https://drive.google.com/folderview?id=0By487VT8_JdWWnkxQ21UUVAwaEk&usp=sharing

I have the downloads - thank you.

Which of those layouts triggers the issue please?

I think it’s the safety_test layout. I’m not 100%, though, it could also be the “test” layout.

Thanks. How long does it take to happen? Straight away or does it need hours to happen?

I’m thinking hours. It doesn’t happen during the day, but I think that’s because I’m working on it throughout the day. When I arrive in the morning I see the error.

OK I’ve left that running. I’ve sent you a PM though about your scheduling as I don’t think it’s as it should be. You’ll sort out your graphics drivers in the interim?

So, I was just browsing the Support forums and I saw this: Object reference not set to an instance of a object. That’s the exact same exception error I’ve been seeing.

It didn’t come up when I searched because I searched “null reference error”.

Alright, so I just arrived into the office this morning and I see the error. However, it’s only on one of the two identical machines running the exact same schedule.

The only difference I can think of is that I installed the latest Intel drivers yesterday on the machine that doesn’t have the error this morning.

We do know some versions of the Intel graphics driver are buggy - so it’s well worth updating that to latest. It’s about the first thing we suggest these days (along with the .net framework updates).