开发者

A first chance exception occurred... and I don't know why

开发者 https://www.devze.com 2023-03-21 00:31 出处:网络
Whenever I try to debug my Windows Phone 7 C# app, I get the following message in the Output window: A first chance exception of type \'System.Overflow开发者_如何学编程Exception\' occurred in mscorli

Whenever I try to debug my Windows Phone 7 C# app, I get the following message in the Output window:

A first chance exception of type 'System.Overflow开发者_如何学编程Exception' occurred in mscorlib.dll

A first chance exception of type 'System.OverflowException' occurred in mscorlib.dll

A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.Phone.dll

...And then, App.xaml.cs opens up in VS (still in debug mode, where I can't edit anything), and "System.Diagnostics.Debugger.Break();" is highlighted.

Why is this happening, how can I fix it, and how can I prevent it in the future?


Why it happened:

I had an image that was used in MainPage.xaml. This image's source's Copy to Output directory property was set to Do not copy, and as a result, the image failed to load and the app crashed.

How to Fix It:

Change the image in question's source's Copy to Output directory property to Copy Always from Do not copy.

How it can be prevented:

Don't fiddle with my image's Copy to Output directory properties.

...and what caused the System.OverflowException:

My low disk space [I think] is what is causing the System.OverflowExceptions, because these continued to pop up in my Output window after I fixed the problem. Read up on System.OverflowExceptions here.

0

精彩评论

暂无评论...
验证码 换一张
取 消