I might have a hard time explaining this because I am at a total loss for what is happening so I am just looking for some guidance. I might be a bit wordy because I don't know exactly what is the relevant information.
I am developing a GUI for a project that I am working on in using .Net (C#)
Part of the interface mimics, exactly, what we do in another product. For consistency reasons, my boss wants me to make it look the same way. So I got the other software and basically copied and pasted the components into my new GUI.
This required me to introduce a component library (the now defunct Graphics Server GSNet, so I can't go to them for help) so I could implement some simple graphs and temperature/pressure "widgets."
The components show up fine, and when I compile, everything seems to work fine. However, at some point during my programming it just breaks. Sometimes the tab that these components are on starts throwing exceptions when I view the designer page (A missing method exception) so it won't display. Sometimes JUST those components from the GSNet library don't show up. Sometimes, if I try to run it, I get a not-instantiated exception on one of their lines of code in the designer code file. Sometimes I can't view the designer at all.
No matter what I do I can't reverse it. Even if I undo what I just did it won't fix it. If it happens, I have to revert to a backup and start over again.
So I started to backup pretty much every step. I compile it and it works. I comment out a line of code, save it, and then uncomment that same line of code (so I am working with the same exact code) and the components all disappear. It doesn't matter what line of code I actually comment out, as long as it is in the same project that these components are being used.
I pretty much have to use the components. . . so does anyone have any suggestion or where I can look to debug this?
The only thing that comes to mind is a read-only bin directory. I've found that .NET has trouble if the interop libraries in the bin directory are read-only. Read-only interops generally prevent controls using those interops from displaying in the form designer and thus mess up compilation (if you do a full build anyway). A rebuild might let you get the app running and then fail when it reaches the part using the read-only interop.
This may or may not be your problem but it's all that comes to mind.
I know this is very late to the game, but I just ran into this same problem.
I'd pulled down one of our applications from SVN, and when I first tried to open the main form for editing, I was prompted with the custom component not being defined in the software, even though I could plainly see it as a class. I was given a choice to ignore it, which I did, and the custom control promptly disappeared from the form (still showed up in the project).
So at the suggestion of my colleague, I deleted the instance from my hard drive, and re-checked it out from SVN. Before i did anything else, I built the project for both release & debug, and that fixed the problem.
Maybe this'll help someone else who finds this SO question when they run into this.
Related
I have created an Windows Form. I have worked very hard on it. I inserted a bunifu button and the deleted it via Form.Designer.cs. The form and it's border still appears (I set border to none) !(https://imgur.com/AWltgCp)
It doesn't work at all.
There isn't a ton of info here. If the project is still open you could try to ctrl-Z your way back. Hopefully you are using some sort of version control. If so you could utilize that. Otherwise I believe we will need to see more code.
This is a problem that happens to me, quite often. But it depends on the code. So, first of all, post your code so we can see it and tell what is the problem. Now, by guessing, possible solutions:
Check your design code. See if you removed anything by accident. If yes try doing it the right way.
Try cleaning and rebuilding your project. Sometimes files can get corrupted and that can help.
Try pressing Ctrl+Z to undo and see if it does something. As #alphamalle said, you should have been using a kind of version control(git, etc.) so you could easily go back to your previous revision.
If all of these don't work, then sadly we can't tell. Please post your code, because the project could have been permanently deleted. Good lesson to use version control.
I'm sure this has been asked and answered, and I apologize for that, but I'm not really even sure what I'm looking for or need to do. I'm an electrical engineer that can play with programming, but when it comes to servers and remote stuff, I get really lost.
Anyway, here's the stick. I'll try to be specific.
I'm not sure this part matters, but I'll try to explain for clarity's sake. We are developing a machine. This machine is run by an IPC. The IPC is basically a PLC that has embedded Windows 7, and the IPC itself is programmed with Structured Text which is written in VS2013 (doesn't work on newer versions). In order to 'activate' the programming and parameters that we set in VS2013, this computer must be connected to the machine with an ethernet cable. I can also remote in to manually control the machine from this computer.
For an operator to control the machine in general, a CS major wrote a program that we call the HMI, or Human Machine Interface. I access and update the code for this, which is written in C#, through VS2017. The project is set up as a solution, and in order to 'activate' this programming after making changes, I just build the solution and copy the dll file over to the machine, through the remote interface. On that machine, we just click an executable that starts the IPC and then I'm guessing the IPC has been linked to the HMI program, because that opens shortly after that.
Ok, now, I'm trying to implement a new feature into this HMI and I'm running into some unknown error. In order to correct this with any program I've written in the past, I would normally set a breakpoint and/or run the debugger and go through step by step until it breaks. However, since this program has to run in tandem with the IPC, which it passes values to and receives output from, it's more complicated than that.
The CS person I mentioned no longer works here, but his note says that the debugger can be run as long as I'm connected with the ethernet cord I mentioned. When I try, though, I get "A project with an Output type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project."
Now, from googling, I've found and tried to set the solution as a startup project, but it didn't seem like anything happened when I selected that, and furthermore, the error persists. I'm guessing that I need to do the latter, which is to 'add an executable project to the solution and set that as the startup project'... but I really don't know what that means, at all.
Do I 'add an existing project' (under File)? If so, would that be the project/solution from VS2013?
Or do I somehow need to add the executable that we click on the machine?
I sound like an idiot, I know, and that's because I am when it comes to this stuff, haha. It may be too complex for anyone to even attempt to answer, or so simple that I'm way overthinking it. I have no idea at this point, and I'm desperate.
That said, I would really appreciate if someone had any idea. Regardless, thank you for your time.
You can debug an executing process by using Visual Studio's Attach to process tool which is in debug menu. This will attach your source code to an executing process as long as the code and process code match.
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.
I am trying to make a text reader, but I found that when scrolling a large document, at some point whenever the texture memory reaches around 15000 the app just exits with code -2147220978 (0x8004020e).
What does it mean? Is there any work around? I really need to be able to read large text documents.
The 8 means "error". The "004" means "this error is specific to the interface that the object was using at the time it failed". The "020e" means... well, it means whatever the author of that interface intended it to mean. (All error codes above 0200 are author-defined.)
These are the hardest errors to track down because their meaning is entirely dependent on what the author of the code that failed intended; there is no universal standard. Some subsystem, perhaps developed by a third party, is failing. If you can figure out what subsystem that is, then you can ask the makers of that subsystem what their error number 020e means.
Can you share minimal and relevant repro code? Just one snippet of XAML And one snippet of C# should be enough.
From what you're saying it really might be overloading the GPU with surfaces until the app crashes. It shouldn't ever happen, so I'm not sure this is the real cause.
In the meanwhile, have you tried virtualizng your ItemsControl? If you're using a ListBox have you tried switching to the new LongListSelector? If just switching to LongListSelector isn't enough, try using ItemRealized and add some prefetching logic. If that doesn't work, you might have to create your own virtualizing logic either by manaully removing the Template from the visual tree once it goes out of view or creating a whole new 3rd party virtualized custom control. Maybe one of the 3rd party control vendors has something that would work here.
As the questions says, I want to write code or debug an appication in real-time without setting breakpoints or pausing/restarting the application.
For example, when I write a game, I want to see what is happening when I change the code for the calculation of the light effects or the AI of the enemies immediately, while running the game on my second monitor.
Update:
Ok, it seems that you guys don't understand exactly what I want.
I want Visual Studio to be more like a WYSIWYG editor...make changes or add new code and see instantly what has changed in my application, without the application to pause it's work.
Update:
I saw this feature in this Video with Java in Eclipse (go to 14:30, where he changes the light effects of the game without stopping it.)
Sometimes. Check out the Edit and Continue feature: http://msdn.microsoft.com/en-us/library/bcew296c%28v=vs.80%29.aspx
Based on the comments, it sounds like you either want a dynamic language (a lot of games are scripted with LUA, or check our IronPython or IronRuby) or you want to dynamically load and reload assemblies, which would require something like MAF perhaps. With that, you could build the bits that you are changing as addins, and then unload and reload the addin assemblies when they change. That seems hacky though, and will likely perform poorly compared to a DLR language.
here is all you want to know abt the Edit and continue feature in Visual Studio:
http://msdn.microsoft.com/en-us/library/bcew296c(v=vs.80).aspx
You can edit the code while debugging, but no instruction will be executed during this time.
If you hit F10, the next instruction will be executed. If you hit F5 the normal execution will continue.
Why not create a resource file with the values to apply. Then have a command you can execute in the app that will reread the file. World of Warcraft has a feature like this. /reload ui
Yes, but unless Edit and Continue is enough for your need you need to design and implement the functionality yourself.
if the change is data driven - just reload the data when some file changes.
if change is in code - consider making that portion of the code to be in separate assembly and dynamically load and rewire the assemebly (may require strongly signed assembly to proper version code). Or dynamically compile code into new assembly (to avoid assembly conflicts in the same app domain).
In all cases you need to figure out how to deal with loosing part of previous state that could be in older objects.