AccessViolationException

Hello, I’ve just recently started using MonoGame on my laptop and have had a greeat time with it. I decided to install it onto my Visual Studio on my desktop, but have been receiving an AccessViolationException thrown from Sharp3D.Direct11. After searching for a fix, ive seen that this has been a very common issue, but people seem to fix it where I cannot. I’ve already tried running VS as Admin. Most other discussion threads I see usually end up never finding a fix. I’m not sure if there is a category for issues like this, but if anyone is willing to enlighten me about this situation, I’m getting this error from a completely untouched project…

1 Like

Can you provide a stack trace?

ere you go :smiley: :

[Managed to Native Transition]
SharpDX.Direct3D11.dll!SharpDX.Direct3D11.D3D11.CreateDevice(SharpDX.DXGI.Adapter adapterRef, SharpDX.Direct3D.DriverType driverType, System.IntPtr software, SharpDX.Direct3D11.DeviceCreationFlags flags, SharpDX.Direct3D.FeatureLevel featureLevelsRef, int featureLevels, int sDKVersion, SharpDX.Direct3D11.Device deviceOut, out SharpDX.Direct3D.FeatureLevel featureLevelRef, out SharpDX.Direct3D11.DeviceContext immediateContextOut) Unknown
SharpDX.Direct3D11.dll!SharpDX.Direct3D11.Device.GetSupportedFeatureLevel(SharpDX.DXGI.Adapter adapter) Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.Graphics.GraphicsAdapter.PlatformIsProfileSupported(Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile) Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.Graphics.GraphicsDevice.GraphicsDevice(Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice(Microsoft.Xna.Framework.GraphicsDeviceInformation gdi) Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice() Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice() Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.Game.DoInitialize() Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.Game.Run(Microsoft.Xna.Framework.GameRunBehavior runBehavior) Unknown
MonoGame.Framework.dll!Microsoft.Xna.Framework.Game.Run() Unknown

Game1.exe!Game1.Program.Main() Line 18 C#

What GPU(s) do you have? If you have an integrated and dedicated GPU, can you try the other one?

At work at the moment so cant remember what my GPU is, Radeon something something. I’ve tried switching to my onboard GPU and the error says that it cant find any graphics device. When I get home I’ll post the specifics of that error.

Not sure if it helps, but I’ve tried ensuring I have the most up to date version of directX, also whenever I try to run dxdiag, the application stops responding :confused:

This screams drivers. I would start with making sure you have actual GPU drivers installed, also make sure to install the DirectX Runtime - link on the MonoGame download page, although I have never had to. Also make sure you select the correct MonoGame build for your VS version.