I couldn't find this exact issue so I apologize if I missed it and created a duplicate question. The only possibilities I could find said that it might be Unity or a DLL.
I'm using Unity 2018.2.21f1 and Visual Studio 2017.
I'm trying to create a desktop duplication app and I've managed to get it to run perfectly in the Unity editor as seen below. It's a bare-bones project at the moment with nothing but a couple of C# scripts, a shader, an Empty object, 2D texture, and a DesktopCapture.dll.
However when I build it as a standalone application, it will run just fine for a moment, but then freeze and crash.
I ran it through Visual Studio during the crash to at least see what it says.
Afterward, when using the Task Manager to manually kill the application, it was still running in the background and I had to fully shutdown and restart my computer just so my system would properly function without having various GUI issues regardless of whatever software I had open. As in, it took a bit to actually get the screenshots because my system wasn't fully responding as it should have.
Below is an image showing the error of "Unhandled exception at 0x00007FF9FD8E1C8E (dxgi.dll) in VR Desktop Mirror.exe 0xC0000005: Access violation reading location 0x0000000000000000."
This is a first for me so I am genuinely clueless. Any help is greatly appreciated and thank you in advance.