windows – Unity standaolne Exe hangs dxgi.pdn not loaded?

I could not find that exact problem, so I'm sorry if I missed it and created a duplicate question. The only possibilities I could find were that it might be Unity or a DLL.

I use Unity 2018.2.21f1 and Visual Studio 2017.

I'm trying to create a desktop duplication application and I've managed to make it work perfectly in the Unity editor, as shown below. For now, this is a clean project with only a few C # scripts, a shader, an empty object, a 2D texture, and a DesktopCapture.dll.

runtime

However, when I build it as a stand-alone application, it will work perfectly for a moment, then will lock up and lock up.

I browsed it in Visual Studio during the crash to at least see what it says.

Then, when you used Task Manager to manually remove the application, it was still running in the background and I had to completely shut down and restart my computer for my system to work properly without having multiple GUI issues, whatever the open software. As in, it took a bit to get the screenshots because my system was not responding completely as it should.

The following is an image showing the error "Unhandled exception at 0x00007FF9FD8E1C8E (dxgi.dll) in VR Desktop Mirror.exe 0xC0000005: Read Location of Access Violation 0x0000000000000000."

visual studio debugging

It's a first for me, so I'm really not aware. Any help is greatly appreciated and thank you in advance.