No window showing when building and running a C# MonoGame project - c#

I've been working on a C# MonoGame project for a few days now and so far it has been building and running fine. I left it alone for a while and, when I came back, the window would no longer display (running as a console application displays a blank console window, but not the application itself).
I don't think it's due to the code itself because the issue started happening without any changes to it.
When building, the program exits with code -1, as shown below in the output:
The program '[12460] Gearworks Physics Engine.exe' has exited with code -1 (0xffffffff).
Note that building the program gives no errors, warnings, or messages.
I realise there are a lot of posts related to "exited with code _" and I have seen some with code -1, but they weren't very helpful to my situation, so I've decided to post my own question instead. Let me know if there's any other information needed to help!

Solved - I simply needed to update Visual Studio to the latest version, which I was apparently not using. Once I did that, all programs worked again.

Related

C# stopped working properly after break from project

Two weeks ago, I decided to take a break from my Unity game project, but, when I came back, I was bombarded with errors on code that works just fine.
This screenshot best describes my problem:
When I hover over "using UnityEngine", it says it's an unnecessary using directive...
I know this problem
and it also happens to me when I take breaks from my code base.
To solve the problem you need to close VS Code and VS and then the Unity Editor as well. Be sure that even their processes are stopped (e.g. through the task manager). Then reopen your Unity Project and wait for all the loading processes to end(you can see that in Unity 2020.x.x in the lower right corner). Then doubleclick a script of yours to open up VS Code or VS. Important!! Dont press or type anything yet as the OmniSharp Server and all your extensions have to load in first. When you see the OmniSharp Server running in the lower left corner and it says "Ready", only then you can start coding.
Explanation
If VS Code isnt fully loaded and you start coding it doesnt detect all libraries and begins to act as mentioned. Be sure to only start coding when the VS Console says "Ready" in the lower left corner.

Visual Studio 2015 C# when typing it keeps going gray?

Whenever I attempt to write in VisualStudio2015 this occurs, where when I try to write, it works out fine for 1-3seconds, then the line I write on goes gray. It does not matter where I position my mouse, I tried with another keyboard to check if any keys were stuck, did not help.
This issue started to occur when I upgraded my PC to Windows 10. Tried several restarts etc.
Please help. This really gets annoying when trying to code :/
I am very bad at explaining my issue here, so please watch this gif to understand. Basically whenever I try to write, that line I am on grays out, leaving me unable to do so: https://gyazo.com/688a5660b29a3d93c0bb426715bcf038
Issue shown
After almost a month I found out the issue was that my CS:GO was opened meanwhile, and it somehow interferes with my Visual Studio and other programs. Thanks for your help though.

Cannot launch applications outside of Visual Studio

I'm having a really strange problem that I just can't figure out. Things I compile in Visual Studio 2015 (C# projects in WinForms and WPF) will not launch outside of Visual Studio. This includes a project that is completely new and untouched. As in, create a new WPF Application, build in debug and release. Go to containing folders click on EXEs and...nothing.
When I run them I get 3 processes appearing in Task Manager (named the same as my application) than cannot be killed (through task manager or command prompt) and nothing else occurs. Nothing in event viewer that seems to correspond to the app. I've attached an instance of VS 2015 to the process and I get the following message: WpfApplication.exe has triggered a break point. Pressing Break takes me to a screen that tells me no debug information is available and pressing continue has no visible effects (I can occasionally see slight movement in the cpu % but not a lot else). Any attempt to stop debugging will cause visual studio to hang and when I end its process VS closes but its memory is not freed up according to Task Manager. All of these same things occur when building in VS2013 and attempting to run outside of VS. Everything runs just fine when run in debug mode inside Visual Studio but outside of it...not a chance.
I literally have no idea where to proceed from here. I can find no error messages or clues to point me in a direction to look. Is there something I'm missing/doing wrong? What steps can I take from here to find the source of the problem?
I've considered it may be something wrong with my computer but I want to explore the possibilities before I do something drastic like a clean install. If the prevailing opinion lies that way then I'll seek help elsewhere!
tl;dr: launching the exe of a compiled application results in no running application and no obvious error messages, how can I proceed from here?
I'm going to post an answer to this because I found out what was wrong but it probably isn't useful to have it hanging around so I'll just delete the question at some point soon.
The main lesson to remember is that the main purpose of anti virus software is to frustrate you as much as possible and if something weird is happening try turning it off briefly and see what happens. You'll probably find that things are now working correctly.
EDIT: I should restate this in a more serious fashion.
Anti virus can sometimes affect things in unexpected ways and turning it off temporarily can save you a lot of time. Keep it up to date too, mine was a version or so old and was not functioning correctly. I updated it and the deep scan now functions as expected rather than silently failing.

Edit and Continue is not working in VS2010 even for 32bit

I have looked at all these but I have not as yet found an answer.
Now that time has moved on is there a solution to this?
Test win form target 3.5 or 4 net.
Win7 Ultimate 64 bit.
Project set to 32 bit as advised.
No fancy code or linked projects or dlls just a standard test project with no code.
I run the form than open the cs code for the form and press CR to add a comment.
I then get the error message...
Edit and Continue
Changes are not allowed while code is running or if the option 'Break all processes when one process breaks' is disabled. The option can be enabled in Tools, Options, Debugging.
My understanding was always that 'Edit and Continue' wouldn't allow you to edit code while your application is 'running'....
You need to pause your code; then you can 'continue'.
If your form is running and you want to add a comment to the .CS code - you need to either have your code hit a break-point first or manually pause your code (cntrl+alt+break - or available in Debug / Break All)
I seem to have the best luck with edit and continue when modifying code at or near the execution point. I'm sure someone can give a technical reason for this, but I don't know it off the top of my head.
(my apologies if you are doing this and I just misread your question)

Visual Studio Bring Background cmd.exe to Foreground

Is it possible to rise a cmd.exe processes from the silent background mode to the visible foreground so I can LOOK at them?
Problem Background:
I'm using VS2008 working with a very large solution containing C#, C++, and Fortran. Occasionally (a few times a day) when building my project the build hangs and does not allow me to do anything in VS (resulting in the need to kill the process). I have checked the output box, and there appears to be nothing helpful there.
Possible Cause:
I am thinking that maybe one of the cmd.exe windows that are spawned in the background may be waiting for some form of input, but to investigate I need to see those windows.
Search for Other Causes/Solutions:
If not this, is there a way to try to check and see if there is something else going on? Is this a problem anyone else is having. (Note: killing VS and reloading often fixes the problem first try, and the build process takes less than 15 seconds.)
If stopping and restart fixes the problem, I guess it's not an input problem.
For example when my build project halts, it's always the VB6 project or SVN that are upset. (strangely the VS projects always work fine).
Once one of these halt, they halt until they are fixed. Thus for the VB projects run and work-out what the model dialogue is saying and fix it. or on SVN it usually need a clean-up run on the directory.
The intermittent nature suggests some sort of timing issue, like a file been lock open etc.
You could attach another copy of visual studio to the cmd.exe and see where it's at. Not sure if you can get symbols for it, so it might be fun to diagnose.

Categories

Resources