FAQ |
Here is a collection of frequently asked questions, common problems and solutions.
This topic contains the following sections:
The setup of the Windows Phone SDK 7.1.1 fails if a newer version of the Microsoft Advertising SDK for Windows Phone is already installed on the system.
Solution:
Solution: Try to reinstall XNA.
For more information see: Object reference not set to an instance of an object error when trying to open project or create new project in VS2010 using XNA 4.0.
When .NET libraries are downloaded from the web, they are treated as assemblies from a network location. This results in a reduced set of privileges on the local machine.
Solution: Unblock the ZIP package before extracting the files. See Installation instructions.
This error message may appear when trying to build content for MonoGame.
Solution: According to https://monogame.codeplex.com/discussions/362886 you need to have
installed. Older version of XNA Game Studio do not work and will cause this error.
Solution: Install the latest DirectX Runtime.
Depending on your Visual Studio settings, you might see first chance exception messages in the Visual Studio Output window. For example: A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll . This message is printed even if the code properly catches and handles the exception. Therefore, this message does not necessarily indicate a problem.
Sometimes exceptions cannot be avoided in .NET. For example, some storage APIs do not allow to check if a file exists, and the only way to check if the file exists is to try to access the file and catch an exception if it doesn't exist.
Whether the debugger breaks on first chance exceptions can be configured in the Visual Studio | Debug | Exceptions… dialog. If Visual Studio | Options | Debugging | General | Enable Just My Code is enabled, the debugger will not handle or log first chance exceptions in third-party DLLs.
This error occurs when an effect built for XNA is loaded in MonoGame.
Solution: Check if the content processor is set to "MonoGame Effect" in the content project and rebuild the content.
This exception may be thrown when trying to build an XNA project.
Solution: Check whether the environment variable "MONOGAME_PLATFORM" is set on the system. If so, remove the environment variable.
This environment variable causes the content pipeline to build the content for a MonoGame platform instead of XNA. The environment variable is set and removed automatically when a MonoGame project is built. However, if the build of the MonoGame project fails, the environment variable may not be removed. This subsequently causes problems when an XNA project is built.
We recommend using the SI standard units. For length: 1 unit = 1 meter (Currently all constants in our libraries are using the SI standard units. If you prefer a different system of units, you need to adjust the constants in the libraries and in the samples.)
Some models in our samples are modeled with a different scale. We correct the scale by settings the Scale parameter of the Model content processor (in the VS Properties window).
Most DigitalRune services support multithreading to exploit all available CPU cores. By default, multithreading is enabled if the system has more than one CPU cores.
To control multithreading explicitly, use the EnableMultithreading properties:
Multithreading can be enabled/disabled at runtime.
Tip: Search the documentation for "multithreading" or "EnableMultithreading" to find all related topics.
Problem: A Math method unexpectedly throws an ArithmeticException ("Overflow or underflow in the arithmetic operation."). This exception may originate in user code or in one of the DigitalRune libraries.
Solution: The problem is usually not caused by the DigitalRune libraries. The problem is most likely caused by a native third-party library, which has set the C floating-point math package into a state that is incompatible with .NET. To resolve the problem call _fpreset as described here: "Overflow or underflow in the arithmetic operation" on StackOverflow
If you are using a feature of the DigitalRune Engine and it is not fast enough, let us know. Many problems can be improved using some simple performance tips. Also, if you tell us how the engine is used and which parts can be bottlenecks, we can try to optimize these parts in future releases.
Please note that we spend a lot of time profiling and optimizing the DigitalRune Engine. However, our libraries are general purpose libraries, which means, they are sometimes not as efficient as a simple highly optimized library which has only a single purpose. For example: The DigitalRune Geometry library supports collision detection with closest-point queries, mirrored objects, many different shape types, and many other edge cases. These features make the engine powerful and simple to use - but it can add a performance overhead.
In addition, the engine is optimized for typical usage in 3D simulations and games. For example, the collision detection and physics simulation are designed for typical gaming scenarios (regarding shape types, number of objects, etc). The API is flexible and can be used for wildly different scenarios (e.g. large scale simulations, ray-tracing, etc.) - but the engine might need minor modifications to optimally support scenarios which we have not anticipated.
If you need maximal performance, you can also download the source code and optimize the code for your specific use case.