The runtime refused to evaluate the expression at this time - c#

I have a UWP App running on Windows 10 / Xbox One that is working fine during runtime, but I can't debug it properly. I'm getting "The runtime refused to evaluate the expression at this time." in all properties of native components. I can see normally the values on my Objects or components, but the native ones no.
Here is when I try to see the content of a StackPanel:
Here is when I try to see the content of my Object:
It worked fine using the VS 2017, now the same code on VS 2019 are giving this problem. I have a fresh installation in a new machine, all the dependencies are installed also.
Is really hard to debug errors in this way, is remember me when I worked developing for MS DOS :)
Thank you everyone.

Related

Using RemoteDebugger to debug C# mono program on Raspberry Pi 3

I'm trying to debug my C#-mono program on a Pi 3 using the latest MonoRemoteDebugger (1.0.10).
The program compiles on both the build machine (a windows 10 64 bit laptop) as well as on the target (Pi 3). The binary also runs on the target machine.
But when i try to remote debug using Visual studio 2015 Community with the MonoRemoteDebug extention it fails.
The debug server that runs on the target machine is found by the extention client.
When i select the server and press connect then it connects.
But when it tries to start the binary it fails, it returns with the message that the .exe cannot be found.
It seems that is tries to find it in the directory of the development machine (C:\users\user\projects\project\Program.exe).
I have followed this tutorial:
https://mmkaram.wordpress.com/2015/04/18/run-and-debug-c-net-on-a-raspberry-pi/
and also read the following post Mono remote debugging from Visual Studio
But i can't seem to get it to work, can anyone help me?
I would suggest you to use Xamarin Studio.
Remote-Debugging from Windows to Linux (for me on a Beaglebone) works without any problems.
https://store.xamarin.com/account/my/subscription/downloads#all-versions
https://eladnava.com/debug-remote-mono-apps-via-xamarin-studio/
I also tried to get the debugging running from within VS. It is "possible", but only very basic and awkward to use.
Xamarin Studio is also free and fully compatible to the VS Solutions. So if you want you can use VS to write your code and then load the solution in Xamarin Studio to do your debugging.

Toubleshooting Unity, Xcode and Server Connection from Device

I am using Unity to build an Xcode project which is then used to build to a device for testing. The other devs can build just fine and we use Source Tree to interact with our Git.
So... for some reason, even though both Unity and Xcode throw no compile errors and successfully build the app (precisely: the Xcode project, then the App) when I launch the App it throws a generic connection error (cannot connect to server, check your internet connection).
We are trying to eliminate the culprit (if there is indeed just one) - but strangely, using the same Unity player settings and Xcode settings (as far as we can tell) - all the other devs can build just fine and do not receive this connection error. The device themselves work fine, and connect through an App built from someone else's machine, but if I build it from my Mac, it does not work.
Possibly relevant info: Unity and Xcode are both pretty fresh installs as I haven't used them before starting at this company. Not sure if Xcode or Unity (or both) are overwriting certain project specifics pulled from our Git?
Edit: this was a versioning issue, and my minor version increase was enough to cause it. Lesson learned: always make sure you are running the exact same version of any shared IDE / Engine.
I almost forgot about this question... I solved this by uninstalling the latest version of Unity and then installing the version the other developers were using.
I am not sure what version of Unity I was using at the time of writing - good learning: always post the version of the programs in question. But I do remember it was only a minor update in front of the others. Some small bug fix which ended up causing this connection error.
To anyone else experiencing this problem - if you are having trouble troubleshooting builds and only getting errors from your local machine: make 100% sure you are using the exact same versions of XCode and Unity.

C# application crashes before start

I come to you because I'm desperate. I've developed a GTK# application in C# with the latest MonoDevelop. It's built for .NET framework 4.0 / x86, and the only external library it uses is the official Mysql .Net connector. It's meant to run under Windows XP.
It's the first application I make with this IDE. I was very happy with the results and the development time, but the deployment is a real headache.
It works perfectly on the development machine. The debug is clean. Everything's okay.
Then, as I couldn't find any information about the deployment, I installed a clean XP to try it and see what do I should install on the client's machine.
I've installed the SP3, .NET 4.0 and copied the release package with all the DLLs mentioned in the build log (that made it work outside the MonoDevelop in the development machine). But I'm getting a "the application has encountered a problem and needs to close" error, with no exception, in kernel32.dll, offset 0012aeb.
I've tried to install the .NET 3.5 before the 4.0, updated IE (just in case...), copied more GTK# and Monodevelop DLLs to the exe's folder, installed the Mysql .NET connector, installed Mono 2.8... But nothing. Still getting that unexplained error.
Google and StackOverflow searches didn't help me. I've researched and tried a lot of things in the last twelve hours or more without moving from this machine.
Do you have any advice? What can be causing it? Is there any way to debug the exe (without installing VS...)? Does anyone know what are all the dependencies of this kind of executable?
WinDbg can help you figuring some JIT trouble...
Even though it aint intuitive and require skills, Worth a try. might pop something up.
If it's meant to run under Windows, then you should probably compile it with the Visual C# compiler.
However, more related to your problem - get a debugger in your deployment machine and run the application on it. This is the best way to figure out the problem because we really can't guess it.
Mono Application Deployment Guidelines
There are several options to installing Visual Studio on your production machine, one of them is the Remote Debugging Monitor. It does not require a Visual Studio installation. You can copy the files from your development machine to your server. I've got them under C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger.
You can also use it for Remote Debugging of a Project Built Locally.

.NET 4 Program written/compiled on Windows 7 machine won't run on XP

I have an app that I wrote using C# .NET 4.0 in Visual Studio 2010 on my Windows 7 Ultimate machine. This app works fine on both Vista and other Windows 7 computers, but whenever someone running Windows XP tries to run it it crashes.
In order to reproduce this I've tried running it on my Win XP VMWare machine and it crashes for me in there. Unfortunately it doesn't give me any specific error, just informing me that the program has crashed and needs to close.
One other user sent me the following:
Run-time error '339'
Component 'vbalSGrid6.ocx' or one of its dependencies not correctly registered: a file is missing or invalid.
Code 0xe0434352
Flags 0x00000001
I don't get that particular bit when I try to run it on my Virtual XP machine, and I also made sure to install .NET 4.0 on there.
What could be causing this, and why won't the app run in XP if the .NET 4 framework is supported for XP?
Components used in the program: DataGridView, ComboBox, Buttons, Labels, LinkLabel, NewtonSoft's JSON parser, and that's about it.
I am baffled and have utterly no idea where to start. Ideas?
UPDATE: Hmm, tried running my other recently created application on XP and it loaded fine. The only major difference (in the components I used anyway) between the two is my use of NewtonSoft's JSON library, which I actually think is a .NET 3.5 component.
UPDATE 2: Just for kicks I tried running the program on my Wind7 machine in "Windows XP SP3" compatibility mode and it ran fine. Of course, I have no idea just how closely the "compatibility mode" emulates a true XP SP3 environment, but I figured I'd give ya'll the info anyway.
¡¡ IT WAS THE APPLICATION ICON !!
I kept noticing that the module it referenced in the error it gave me was system.drawing which I thought was odd. I figured perhaps the PictureBox I was using was causing the issue, so I tried disabling everything to do with that, to no avail.
I had my business partner set up his XP box so that we'd have another machine to test with aside from my VMWare XP box just in case there was some odd issue with it.
After he got it set up and the app copied over he said "The icons look like DOS ones" and I had a eureka moment.
I was using .PNG's as the icons because they support transparencies and whatnot, but XP doens't natively support them. So when the app was copied to the desktop it just used a generic icon for it, and when the application was run it crashed because XP doesn't know how to render a .PNG.
Try using the Fusion Log Viewer to debug startup errors in .NET applications.
Scott Hanselman has written a nice howto along with links to further resources if you need to go deeper.
Are we sure this is some wierd .NET compatibility issue or just a run of the mill bad installer/deployment problem?
Here's one user who has that error message because the OCX DLL was copied to System32 with a shortname. Renaming the DLL to the correct name and running RegSvr32 resolved his problem.
Do you have an installer? Have you correctly identified all of your managed and unmanaged dependencies and properly authored them into your installer?
http://forums.elmsoftware.com/forum_posts.asp?TID=119

C# WinForms App won't run on Win7 after Building

I have a program that I built that reads and writes files. I built it in Release mode, then tried to run the exe on Win7. At first, with troubleshooting on, Windows simply told me the application closed and it was looking for a solution. After a few seconds, the dialog would disappear and show nothing more.
So with some significant effort I got the debugger attached to the process, but it was only showing me disassembly, which tells me that the error taking place wasn't in my application code, but in the framework somewhere.
The strange thing is that when I let the debugger attach, then press "stop" in VS, and exit the debugger, the program actually runs at that point!
So now I'm stumped. I have an application that builds, that seems to be having a permission error when I run it, but if I let the debugger attach then close it, it runs, and there's no Exception to really look at.
How I troubleshoot this issue?
Edit: Responding to Merlyn:
It's a custom app written from scratch in c#. The only dependency it has outside of core .NET namespaces is the Ionic.Zip DLL.
Visual Studio 2008 (Writing in C# 3.5)
Windows 7 - Home Premium, v6.1 build 7600
CPU - x64 quad core
CPU are you compiling under: Any CPU
I haven't tried it on another machine or a different version of VS.
Edit: I was able to try the compiled version on another win7 computer, and it worked without issue, so it looks like a security (?) issue on my computer only.
Try it in the debugger with Just My Code disabled and Native Code enabled, then check the call stack.
Also, what happens if you run it directly in Visual Studio?
Uncheck Enable Visual Studio Hosting Process in Project Properties and see whether it still works in VS.
I'd suggest sending the issue to Microsoft support. Especially with the data given here, you will have an easy time convincing them it's their problem. You might need an MSDN subscription for that.

Categories