Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi This problem I have only with C#
I wrote a program, that works fine for a few months, then it stops running outputting errors, till I recompile it with VS without any change in code.
Then it works again for a few months.
Why?
Someone has a clue?
Aren't executables written on C# valid till something start to be incompatible and require some code change?
Why I need to recompile the same code on the same VS version for the program to work again?
Thanks
Eli

What I have tried:

I Recompiling various times, but I don't have anything to debug, the program works fine (if recompiled) for months
Posted
Updated 19-Sep-18 20:17pm
Comments
[no name] 17-Sep-18 19:22pm    
How have you arrived at the conclusion that the recompile is responsible for this behaviour? Have you considered all the possibilities and done some very comprehensive testing? I suspect not but if you have please provide details.
Member 10212036 20-Sep-18 2:32am    
Hi This is the third time I had this problem, and Yes, at first I tried to find out the problem in "my code" added breakpoints and tried to debug, but there was nothing there, the program worked fine.
The second time I didn't touch the code, simply recompiled it and it worked...
This third time tried to enter VS and run it from the outside, didn't work, but after pressing the green arrow and closing the program immediately, without really using it, it worked again from outside...
I do not know what to think... this points out the VS output isn't a complete executable??? something needs to be updated periodically???
Next time it fails I post the Error screen
Thank for your comments
Eli
johannesnestler 18-Sep-18 7:15am    
compiled output has nothing todo with VS anymore - it's an executable and can't change itself. If you recompile you create a new independend executable - that should be clear in every compiled language. So stop this thinking and try to find the root of your problems. What Errors, what mean's "Stops running", ...
Simon_Whale 20-Sep-18 10:41am    
Does the Windows Event log on the machine show anything?

when it crashes does the task manager show anyhthing out of the ordinary? i.e. high RAM use? high CPU use?
Member 10212036 20-Sep-18 12:14pm    
No, nothing, and it runs again without freeing no RAM, on the contrary since when I add VS to recompile it it runs + VS without problem...

Very strange, but the recompile is completely unnecessary.

Without seeing the error messages and what the code is supposed to be doing, it's impossible for anyone to tell you anything useful.
 
Share this answer
 
I understand, I was expecting someone else got this issues, and can bring some light to the reason.
Now the program is working(without Visual Studio running) therefore I have no errors to show.
The function of the program is accessing the internet in order to fill up costs of electronic components on a BOM. It finds the lowest cost for the component, fill the cost and the distributor that supply with the lower cost.

Last time when I got the error I tried to enter VS without recompiling, but that wasn't sufficient.
Next time it happens I will post again with a screenshoot of the error.
Also I will enter VS and try to run it from VS but on release instead on debug.

In the meantime will be interesting if someone else had this problems.
(Else I will believe I have little green trolls into my PC)

Thanks
ELi
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900