ClickOnce & XNA issues - c#

I essentially have a blank XNA project built using the XNA 3.1 wizard, i'm testing whether a game i make can be "installed" on another computer without having to make them install everything manually to make it work.
The only additional code in the game is:
Components.Add(new GamerServicesComponent(this));
After going through the ClickOnce publishing stage i copied it to a USB drive and attempted to run the "setup.exe" on a Windows Vista computer with no Visual C#/Studio or XNA installed.
According to the MSDN entry the ClickOnce will actually include everything necessary to make the game work on the computer, yet after the installation i get the dreaded "... has stopped working" when i try to run it.
Does anyone know how to get around this? I assumed the reason it says it can be done is because it works.
Thanks
http://msdn.microsoft.com/en-us/library/bb464156.aspx
Edit:
Just noticed that the article states that the Games for Windows - LIVE is not included in the distributable, would this mean if it was included as a component in the XNA game it would cause the crash when i attempt to run it?

When an application says "has stopped working" for no immediately apparent reason, that's usually a sign that an unhandled exception has occured. Since MSDN states that the GamerServicesComponent class is not available without the XNA Game Studio installed, that seems like the most plausible explanation.
Why is it available, then? Well, you need something to program up against; you wouldn't be able to use auto-completion and such if you didn't have the class, because VS wouldn't know what it looked like
Getting it to compile for, say, XBox 360, where I would guess that the class CAN be used, probably wouldn't work either if it didn't know anything about the class.

To address the general problem of a ClickOnce application which "has stopped working" immediately, you can get more information on your particular problem by looking in the Windows Event Viewer:
http://windows.microsoft.com/en-US/windows-vista/Open-Event-Viewer
Like Michael mentioned, this is often an unhandled exception, but this way you can see WHAT the unhandled exception was.

Related

All my Unity projects contain blank compilation errors (only the timestamps), preventing any projects from working or importing correctly

I really need some help. I was rearranging file locations and trying to clear up some space and somehow broke the ability for Unity to operate on my laptop. The pictures of the errors are below.
This all started when I was moving a completely functional unity project from an external SSD to my internal laptop SSD. I had to clear space for the size of the project and I must have deleted something important, but I have no clue how to tell what it is.
Error seen when opening project
Editor view after opening
Error when trying to attach a script to a GameObject
Error in editor log
Steps I've taken:
I've restarted my computer several times.
I've completely uninstalled all editor versions and the unity hub (twice), including deleting all local app data for unity, emptying the temp bin, and clearing the keys in the registry.
I've started completely new projects, checked
old ones that used to work, downloaded sample ones from unity learn
just to make doubly sure that it's not me being dumb.
My current theory is that this has to do with me clearing some data from a National Instruments folder. I'm new to programming and just read online that these drivers are needed for .NET communication, but would this be why Unity keeps failing then?
This has all taken more than a few hours and I'm struggling to fix this if anyone has any suggestions, please. I'd really appreciate any insight.
Update: I'm able to make new scripts, objects, scenes, etc. but I can't attach any script components to game objects because "the script class can't be found"
Update #2: Checking the Editor logs shows that the Tundra build is failing, and the "93 items updated" matches the 93 errors that are shown. No idea what Tundra is, but that's something to look at now!
Update #3: fairly more certain it's something to do with the .NET interactions, but I'm completely unknowledgeable about this and worried about breaking this further
Answering my own question in case another person finds this and has the same issue, but the problem wasn't .net related or anything I mentioned. I uninstalled anaconda which caused some issues with the Command Prompt, where it would close immediately after opening. Unity uses this for a number of processes, so that's what caused all the blank errors.
The solution is to delete the Microsoft Command Processor AutoRun key in the registry editor.
https://forum.unity.com/threads/unity-empty-errors-on-every-project-unity-2021-3-2f1.1279124/
Cmd crashes with exit code 1 after uninstalling anaconda

Building a UWP app coded in xamarin.forms in release mode results in Internal compiler error: Specified cast is not valid

I've something really annoying happening im my code.
I've built an app in Xamarin.Forms after battling for months with the framework just to find that when I'm now done, I cannot build my app in release mode to deploy it to the Store.
The app works well in debug mode, but does not build in release mode in the UWP project. I have been struggling to find a way to build my app in release mode for 5 days. but no matter which solution I see in all the forums and the stackoverflow questions I encounter, this error won't even blink.
The error which the IDE shows when I build the app in release mode is:
Internal compiler error: Specified cast is not valid.
It does not tell me anything more than that. The IDE doesn't give me any additional error message. I have struggled for days applying solutions I find to similar to this online, but nothing works.
I have updated IDE
Updated all packages
Deleted custom renderers on the UWP project
I went through every portion of code to find where I may have made a bad cast
I tried all I could find online, but nothing works.
I usually don't ask questions on forums unless it becomes critical.
If I don't get any solution, I'll be forced to delete this project and waste the months of coding I did, and abandon Xamarin for ever and move to Flutter which has a better reputation when it comes to tooling.
First of all, please don't fume so much. We understand you are frustrated, but Caps Lock just doesn't help to make us take it more seriously. Also I know Flutter is the new "cool guy in town", but it also has its set of issues. Cross-platform development is not simple and Flutter does support only two platforms, while Xamarin.Forms have a wider reach, which is bound to bring a bit more complexity.
My first suggestion would be to change the build output more verbose in Visual Studio Options, because that could uncover the actual issue here. When it comes to release mode, the problems usually come from types which are used for reflection but the compiler does not see as used and hence throws them away. Usually these errors show up at runtime however. In your case I would suggest a few following things:
First and foremost - try to delete bin and obj folders in your project. That might help, as they sometimes get cluttered with older libraries and create conflicts.
If you have been building with a source control like Git (I hope you did), I would suggest going back to some early commits and then try to build release mode there. If the project builds, jump forward to some newer commit and try again. If it does not, try an even earlier commit. The goal of this is to pinpoint when in time was the error introduced, which should significantly help you in searching where the problem comes from.
If you didn't use any source control - first remember to do so next time. However, this time you will have to do it "the old way". Create a new project and slowly as little code from the original project, trying to do release build at each step. Hopefully this will allow you to find the culprit code and then you will be able to fix it in the original project
You can definitely post your findings here and we will be happy to help you further - like pinpointing the actual problem in the code file once you narrow it down.
I suspect your problem is coming from auto-generated XAML, so definitely make sure to focus on the .xaml files adding them one by one.

How do I determine why our application crashes for some people, but not others?

This is a tough problem, which I'm not sure how to solve. (Hence my asking here, :) ) I'm on a team of about a half dozen developers working on a WPF app. At this stage we've got a working application. Not all of the features are in it yet, but we're making progress. Everyone on the team can run the app, except for our boss who has a problem running it. When the app first starts it brings up a start screen/landing page with some buttons. All of the rest of us when we run the app we can easily click on any of the buttons. One of these buttons is labels "Orders" and takes the user to another screen where they can work on the orders. When our boss runs it, the app always crashes. However it doesn't do this at all for me, nor any of the other developers. This makes it really hard to figure out what's wrong because I can't duplicate it. I've got to admit that the problem might not be with WPF, but might instead be with the .NET framework, but at this point I don't know. I've got to start somewhere.
So ultimately the question is this, how do I determine what's failing on a different machine than my own? One that I don't have access to?
We're working with VS 2015, .NET Framework 4.5.2.
Diagnostics and logging.
Add as much diagnostic code as you can think of (and then add some more) to the code and log it to a file or the event log or a remote database or where ever. This would include call stacks, parameter values, system information etc. Then when the application crashes you can examine these logs and determine what's different between your machine and the customer's.
Without this information you're just guessing.
Quick check before you do anything else: right after a crash run Event Viewer and go to Windows Logs -> Application. You should see a number of messages related to the app and the crash including exception information that often sheds light on exactly what's going wrong.
You can put some crash report controls,
Find similar question hear exception-reporting-from-a-wpf-application
or try something from hear : CrashReporterdotNet
,
Crash nuget
This is a long shot, but easy enough to research. Your problem may have its root cause in hardware. Compare the video cards of your peers and boss. Your boss may have a card that's not within the Microsoft recommended guidelines. In WPF, there are ways to manage rendering based on the hardware.

Click Once in Windows 10 NotifyIcon not displaying

So using the following diagram:
You can see that the only time when anything breaks is when I use ClickOnce in Windows 10, however the notifications work perfectly fine if I run it directly from the exe. When I run it using ClickOnce using the console I can see the same methods get hit in the console but the notifications don't show up. I have tried to get this fixed for a very long time now with no avail.
The click once is deployed to a network share. The ClickOnce notifications work fine on Windows 8. I have absolutely no idea what could be causing this.
So got into discussion with someone I know at Microsoft and it looks like in the latest version (that he said should be released somewhere in November 2015) should contain the fix for this issue.
Waiting it out and hopefully the fix comes, if not I will contact him again and see how things are going as I would say this is a really bad problem.

c# application working on development machine, fails on non-development machine

this problem has me baffled.
I'm writing an application which is supposed to take information from a form, pass it to a background worker which then a) writes the information to a local xml file and b) inserts the information into a remote MySQL database.
On my development machine, it seems to work flawlessly. The remote database is updated, the xml file is created if necessary and updated if it already exists. It's working.
Even if I exit out of the development environment and run the release build independantly of the IDE sandbox, the code works.
But, if I put it on another machine, the code fails and I dont understand why.
I'm currently using Visual Studio 2010 Professional on a 32 bit Windows 7 Ultimate machine.
At the moment, I'm finding that the application is stopping at a fairly specific point, which seems to be precisely where the background worker starts doing things like accessing the file system or accessing the remote database.
The project consists of a single exe file and a dll, which has a custom control I designed in it. The custom control is working fine, in that it shows what I want it to and returns the values I'm asking it to when I want it to, so it would seem that isn't to blame.
I initially thought I could be looking at a permissions problem, but running the application as administrator gets me the same response.
I've been writing using version 4 of the .NET framework, however I've just downgraded that to version 3.5 in the hopes that that may help. Both the non-development machines I've tried have been up to date - or have been brought up to date by me - prior to attempting to run the application.
I'm honestly baffled here. Any suggestions would be most welcome.
Alan
If your code fails, it most likely means there is some uncaught exception. What you should do is to log all uncaught exceptions (and probably some of the caught too) to a file, possibly using something like log4net.
I don't think we can help you beyond that.
I have written a live logging utility called Donsole for diagnosing the application in such conditions. On the developer workstation, it is very easy to diagnose using the feature-rich debugger of VS. The utility app. helps the developers exactly in this kind of scenarios where they don't have any idea what's happening inside. I recommend you download the latest build and try it for yourself. Explaining how to use this utility and how it works is beyond the scope of this answer, so I'd forward you to the codeplex page of the project.
http://donsole.codeplex.com/
This is how it looks.
Take a look at the event viewer of your operating system. Administrative Tools>Event Viewer>Windows Log>Application.

Categories