Hi,
I am create programmatically various controls and add them to a Page. The application fails with a “Application Error”, Null Object exception. That could of course be anything. The actual problem is that the code does not stop the execution at the exception, so, basically, I cannot debug. Any idea why is this happening?
Best regards,
Alex
Thanks. Will investigate.
I’d suggest to remove as many font and custom color assignments as possible to let the themes handle that and be able to update your app just by changing the theme. In VWG the themes were kind of limited and very difficult to manage. Now you can give your web app a very modern look and use multiple themes without breaking the layout: i.e. the non client areas are recalculated, while VWG didn’t adapt the metrics to the theme.
The font settings I found are:
My code
lblControlTitle.Font = new System.Drawing.Font(“Tahoma”, (float)11.00, System.Drawing.FontStyle.Bold);
lblControlTitle.Font = new System.Drawing.Font(“Tahoma”, (float)11.00, System.Drawing.FontStyle.Regular);
From Designer code
this.lnkSearch.Font = new System.Drawing.Font(“Microsoft Sans Serif”, 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
Alex
It looks like it was related to an unexpected font setting. Could you check your Font = new Font() assignments and maybe send me some samples of the font settings to see what we had missed?
Hi Luca!
Yes! It is fixed! Thank you very much!
And I just saw in my browser part of my Visual WebGui solution converted to Wisej ! I think I have to work on the looks now, cause the “Vista” theme I was using was very Windows-Desktop-application-like and it look way different now! But it is promising!
Thanks again.
Alex
Please try the update just posted.
Best,
Luca
Hi Luca, thanks for your answer.
Please keep in mind that I have not played with Themes/Builder at all. So I don’t know if my exception is related to yours, although you said it is “similar”.
Best regards,
Alex
Yes, thank you. I was just about to write that we have a similar exception in Theme Builder and it’s caused by shared code. Should be fixed shortly. I will post the list of fixes soon.
Hi Luca,
I’m sorry, I can’t send the code, it’s rather complicated depending on other projects etc. However, I made some progress: I had the “Just My Code” enabled, so exceptions coming from outside my code were ignored. Now that I disabled that, I get a NullReferenceException at Wisej.Core.dll, but then the debugger is trying to find the Wisej.Core.pdb file which is not present. Below, I attach the Call Stack.
Best regards,
Alex
> Wisej.Core.dll!Wisej.Core.ClientThemeReader.IsThemeFont(System.Drawing.Font font) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.TranslateFont(System.Drawing.Font font) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeValue(Wisej.Core.WisejSerializer.JsonWriter writer, object value) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeField(Wisej.Core.WisejSerializer.JsonWriter writer, string name, object value, bool first) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeObject(Wisej.Core.WisejSerializer.JsonWriter writer, object value) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeValue(Wisej.Core.WisejSerializer.JsonWriter writer, object value) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeInternal(object value, Wisej.Core.WisejSerializerOptions options) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.Serialize(object value, Wisej.Core.WisejSerializerOptions options) Unknown
Wisej.Core.dll!Wisej.Core.ResponseManager.ResponseAction.Wisej.Core.IWisejSerializable.Serialize(System.IO.TextWriter writer, Wisej.Core.WisejSerializerOptions options) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeObject(Wisej.Core.WisejSerializer.JsonWriter writer, object value) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeValue(Wisej.Core.WisejSerializer.JsonWriter writer, object value) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeArray(Wisej.Core.WisejSerializer.JsonWriter writer, System.Collections.IEnumerable list) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeValue(Wisej.Core.WisejSerializer.JsonWriter writer, object value) Unknown
Wisej.Core.dll!Wisej.Core.WisejSerializer.SerializeInternal(object value, Wisej.Core.WisejSerializerOptions options) Unknown
Wisej.Core.dll!Wisej.Core.ResponseManager.SendActions() Unknown
Wisej.Core.dll!Wisej.Core.ResponseManager.ProcessResponse() Unknown
Wisej.Core.dll!Wisej.Core.ResponseManager.OnLoad(Wisej.Core.Session session, dynamic message) Unknown
[Lightweight Function]
Wisej.Core.dll!Wisej.Core.ResponseManager.ProcessRequest(Wisej.Core.ResponseManager.ServiceType service, dynamic message) Unknown
[Lightweight Function]
Wisej.Core.dll!Wisej.Core.HttpHandler.ProcessHttpAppRequest(System.Web.HttpContext context) Unknown
Wisej.Core.dll!Wisej.Core.HttpHandler.ProcessRequest(System.Web.HttpContext context) Unknown
Wisej.Core.dll!Wisej.Core.HttpHandlerAsyncResult..ctor.AnonymousMethod__0() Unknown
mscorlib.dll!System.Threading.Tasks.Task.InnerInvoke() Unknown
mscorlib.dll!System.Threading.Tasks.Task.Execute() Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecutionContextCallback(object obj) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) Unknown
mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Unknown
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Unknown
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Unknown
[Native to Managed Transition]
If VS doesn’t break at the exception it probably means it’s not attached to the IIS instance in debug mode. When the “break on throw” option is on you should get a bunch of exception on startup:
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll Additional information: Access to the path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\~AspAccessCheck_643d3c3211712.tmp' is denied.
Enabling the JavaScript break works only if you are debugging using IE and have enabled “Script” in Debug->Attach to Process. However, VS cannot debug both .NET and Script.
Can you send the test case?
Hi Luca,
Thanks for this new (to me) feature of Visual Studio, I had never seen that before!
Unfortunately, checking the CLR exceptions (in fact I also checked the Javascript exceptions later) did not make any difference. I keep getting in the browser the attached as image. When I click either od the two buttons (the OK and the smaller empty one) I go to a blank browser….
Actually I cannot attach it, I get a “forbidden” error… Oh, well … It looks something like
Application Error small Empty button
Object reference not set to an instance of an object.
OK button
Best regards,
Alex
Hi Alex,
To make VS break when the exception is thrown:
The settings are saved with the project user settings.
Best,
Luca