C# I'm getting this error from SlimDX: first chance exception 'slimdx.direct3d11.direct3d11 exception'

but I can't seem to figure out why/where/when. I've turned on every kind of debugging possible, my D3D Device is in debug mode, I have un-managed debugging enabled, I have every form of messaging/breaking turned on in the DirectX Control Panel etc.

The strange thing is that when this error message occurs, my program keeps running flawlessly and does not break. It wouldn't even be noticeable if not for the message in the output window. I've tried logging things to the console but it's difficult to know where one thing is starting and another ends because I use multiple threads and such. I tried using a reference device but my app sort of hangs when I do that, and I've run this in PIX but I don't see any errors when I do that

Kinda strange. It would be nice if it would just break properly so I could debug it.

Any thoughts? ...

D3D11: INFO: Create InputLayout: Name="unnamed", Addr=0x06C91304, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097264: CREATE_INPUTLAYOUT ]
D3D11: INFO: Create BlendState: Name="unnamed", Addr=0x06C917BC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097270: CREATE_BLENDSTATE ]
D3D11: INFO: Create DepthStencilState: Name="unnamed", Addr=0x06C919AC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097273: CREATE_DEPTHSTENCILSTATE ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C03B64, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create ShaderResourceView: Name="unnamed", Addr=0x06C91DE4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097240: CREATE_SHADERRESOURCEVIEW ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C0401C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create ShaderResourceView: Name="unnamed", Addr=0x06C038EC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097240: CREATE_SHADERRESOURCEVIEW ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C04A34, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create ShaderResourceView: Name="unnamed", Addr=0x06C041F4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097240: CREATE_SHADERRESOURCEVIEW ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C05024, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create ShaderResourceView: Name="unnamed", Addr=0x06C04594, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097240: CREATE_SHADERRESOURCEVIEW ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C04C0C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create ShaderResourceView: Name="unnamed", Addr=0x06C043B4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097240: CREATE_SHADERRESOURCEVIEW ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06C00264, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create VertexShader: Name="unnamed", Addr=0x06C004F4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097249: CREATE_VERTEXSHADER ]
D3D11: INFO: Create PixelShader: Name="unnamed", Addr=0x06C008AC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097261: CREATE_PIXELSHADER ]
D3D11: INFO: Create InputLayout: Name="unnamed", Addr=0x06C00C74, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097264: CREATE_INPUTLAYOUT ]
D3D11: INFO: Create RasterizerState: Name="unnamed", Addr=0x06C054C4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097276: CREATE_RASTERIZERSTATE ]
D3D11: INFO: Create Sampler: Name="unnamed", Addr=0x06C05684, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097267: CREATE_SAMPLER ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C05CDC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
A first chance exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll
D3D11: INFO: Destroy RenderTargetView: Name="new_ToScreenView", Addr=0x06BEEE44 [ STATE_CREATION INFO #2097245: DESTROY_RENDERTARGETVIEW ]
D3D11: INFO: Destroy Texture2D: Name="new_Swapchain_Texture", Addr=0x06BE9C04 [ STATE_CREATION INFO #2097236: DESTROY_TEXTURE2D ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06C05AFC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create RenderTargetView: Name="unnamed", Addr=0x06BEEE44, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097243: CREATE_RENDERTARGETVIEW ]
D3D11: INFO: Destroy DepthStencilView: Name="unnamed", Addr=0x06BF20D4 [ STATE_CREATION INFO #2097248: DESTROY_DEPTHSTENCILVIEW ]
D3D11: INFO: Destroy Texture2D: Name="D3D_depthStencil", Addr=0x06BEF1B4 [ STATE_CREATION INFO #2097236: DESTROY_TEXTURE2D ]
D3D11: INFO: Create Texture2D: Name="unnamed", Addr=0x06BEF1B4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097234: CREATE_TEXTURE2D ]
D3D11: INFO: Create DepthStencilView: Name="unnamed", Addr=0x06C060AC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097246: CREATE_DEPTHSTENCILVIEW ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x0AC90614, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create VertexShader: Name="unnamed", Addr=0x0AC9086C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097249: CREATE_VERTEXSHADER ]
D3D11: INFO: Create PixelShader: Name="unnamed", Addr=0x0AC90C04, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097261: CREATE_PIXELSHADER ]
D3D11: INFO: Create InputLayout: Name="unnamed", Addr=0x06C0639C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097264: CREATE_INPUTLAYOUT ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06C067CC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06C06B54, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06C06F2C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06C07304, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
A first chance exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06C07C04, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x0AC9187C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create VertexShader: Name="unnamed", Addr=0x0AC91B0C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097249: CREATE_VERTEXSHADER ]
D3D11: INFO: Create PixelShader: Name="unnamed", Addr=0x0AC91EC4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097261: CREATE_PIXELSHADER ]
D3D11: INFO: Create InputLayout: Name="unnamed", Addr=0x06BF393C, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097264: CREATE_INPUTLAYOUT ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
A first chance exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x06BF43EC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: Create Buffer: Name="unnamed", Addr=0x0AC93CB4, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097228: CREATE_BUFFER ]
D3D11: INFO: Create VertexShader: Name="unnamed", Addr=0x0AC93F44, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097249: CREATE_VERTEXSHADER ]
D3D11: INFO: Create PixelShader: Name="unnamed", Addr=0x06BF4CAC, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097261: CREATE_PIXELSHADER ]
D3D11: INFO: Create InputLayout: Name="unnamed", Addr=0x06BF5074, ExtRef=1, IntRef=0 [ STATE_CREATION INFO #2097264: CREATE_INPUTLAYOUT ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
D3D11: INFO: ID3D11DeviceContext::Draw: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here.  [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]
A first chance exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll

Thanks

edit:

After adding this code I was able to see a bit more:

AppDomain.CurrentDomain.FirstChanceException += 
    (object source, FirstChanceExceptionEventArgs e) =>
    {
        Console.WriteLine("FirstChanceException event raised in {0}: {1}",
            AppDomain.CurrentDomain.FriendlyName, e.Exception.Message);
    };

Now I see this: FirstChanceException event raised in nART.exe: D3D11_ERROR_FILE_NOT_FOUND: File not found (-2005139454)

This might set me on the right track here. I am now able to use a break point and I think I'm getting close to finding the culprit.

有帮助吗?

解决方案

You should be able to open Debug > Exceptions and check 'Common Language Runtime Exceptions' 'Thrown' which will break execution on all managed library exceptions even if they are handled.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top