Forum Visual Studio
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Debug.Assert not working, no assertion dialog

zipperlezipperle USUniversity ✭✭

Since I have started my project two years ago, I have never seen that any Debug.Assert has been hit (showing the assertion dialog) when the assert condition fails. I have searched the forum and I googled for the issue, but I found not much, so it seems that this may related just to me and my development environment!? According the to my search results it seems Mono is supporting this for several years now, also the xamarin documentation says that it is possible. I already did some tests and tried several things out, but no luck. I have checked my project settings under the "Build" tab and "Define DEBUG constant" is set. I also did edit my app.config and added
<system.diagnostics> <assert assertuienabled="true" logfilename="c:\\my.Trace.log" /> </system.diagnostics>
So app.config now looks like this:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.diagnostics> <assert assertuienabled="true" logfilename="c:\\myPumpDrive.Trace.log" /> </system.diagnostics> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="XLabs.Serialization" publicKeyToken="d65109b36e5040e4" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.0.5782.15703" newVersion="2.0.5782.15703" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.7.0" newVersion="2.6.7.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.7.0" newVersion="2.6.7.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>

The assertion UI is not showing and the log file is not being generated anyway.

My environment is VS 2015 Update 2, Xamarin 4.1.1.3, Xamarin.Android 6.1.1.1, Xamarin.iOS 9.8.1.4.
My recent tests were on android device and Xamarin Android Player. But as I said I have never seen this working, even when I was working on VS 2013 and iOS/Android in the past.

Sign In or Register to comment.