vb.net console application crashes - vb.net

i have created a very simple console application in vb.net that emails me some info from the db daily. everythign works in my dev environment, however when i move it out to production and try to run the executable, i get the following error message:
"A problem caused the program to stop working correctly. please close the program"
i have put in some exception checks in the code:
Dim output As String
Try
output = FormatIndividualRecords(False)
'SaveToFile(output, "NIndividualRecords.doc")
''email files
'Emailusers()
Catch e As Exception
WriteLine(e.Message)
End Try
and i expected the error to show up on the application console, but it does not, is there another way for me to see what error is being thrown? there is no development environment set up in production (no visual studio, etc), is there maaybe a log that that i can look at? how do i catch the error that's causing the app to fail?
Thank you in advance!
EDIT: i chagned the WriteLine(e.Message) to console.write(e.message) now there appealrs to be a message on the console when i run the application, but it blinks too fast and closes, i don't have time to see what it is... how can i get the console application to remain open?

Try directing output of the app to a file, rather than to the console...
MyProgram.exe > log.txt

Related

Weblogic - Python script in order to deploy many applications

I have a strange problem. I deploy many ear and war files with a Python script. However, during the second app deployment, I always get the following error message:
Property APPLICATION.CONF.REFRESH not found
And in the other MS - DOS window where the script is executed, I get this warning / error:
<Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
Both messages seem to me erroneous.
The message with Property is runnig the whole time and nothing works anymore.
What could be my error?
Here is my script:
connect(username, pwd)
edit()
startEdit()
cd('/')
cd('AppDeployments')
deploy(fileName, path, targets='AdminServer')
save()
activate()
disconnect()
exit()
This script gets executed 5 times in a row.
Thanks for any help!

Hi I am getting Access denied error when consuming a wcf service

Error:
Cannot open 'C:\Users\veeru\Documents\Visual Studio
2015\Projects\WCFProject\HelloServiceHost\obj\Debug\HelloServiceHost.exe'
for writing -- 'Access to the path 'C:\Users\veeru\Documents\Visual
Studio
2015\Projects\WCFProject\HelloServiceHost\obj\Debug\HelloServiceHost.exe'
is denied.'
You will get this type of error when you have launched HelloServiceHost.exe directly from output path of VS project and trying to build solution/project while exe instance is still running. Or exe instance is still hanging there in memory because of unknown reason. You can try following steps:
Go to Taskmanager and check if you have instance of HelloServiceHost.exe running there and if its then kill it.
If answer to step 1 is negative then close your Visual Studio and reopen it.

Keep getting : Debug error BC31019 : Unable to write to output file 'path/form.exe System Error &H80070005& VB.NET

I'm using Visual Studio Professional 2013 and I'm doing some very basic windows forms application.
A month ago, I could do everything I wanted without any problem. But I started some new projects today and for absolutely no reasons, I keep getting this error message when I come to debug or compile:
Debug error BC31019 : Unable to write to output file 'path/form.exe System Error &H80070005&
It can happen simply by changing the size of a textbox or modifying the text content in a label... It's very random... And I can even do an undo (ctrl+z) and then I can debug again, but if I try again to do the thing I did that brought the error message, the same message pops again as I try to run.
After reading a little about the subject, I realized that it was because the .exe file became in read-only mode and when I try to remove it, windows wont let me.
The only thing I can do if I really want to continue, is to restart my computer every times it happens. Then I can continue just like normal as my .exe file is no longer in read-only...
I tried tor run a sfc/scannow in my command prompt to see if i had any problems with my frameworks but everything was fine.
Since, it is when i restart my pc that the bug disapears, isn't anything i can do or run somewhere to do the same thing. I need to find why the exe file goes to read-only for nothing and how to get it back to normal without having to restart my pc every time...
Please help me!
thank you
I came across the same issue and it was related to having a command line argument that VS could not find, then when i clicked stop debugging I ended up in this situation as it seemed VS kept a process running.
I could see this process in task manager but could not end it (it started with the same name as my app)
I found closing VS would release this process.
Restarting VS it would then work ok again.
there may be other ways to reproduce the issue but restarting VS seems to release the file and allow you to continue.
I set the exe properties to Read/write. No effect, but when I set app properties/settings to "Always on top" = False the issue went away and is still away.

Cannot debug some of the code in process w3wp.exe (Debugger is not registered)

Attempting to debug a VB.NET Visual Web Part I am receiving the following error message.
This error happens straight after I press play and and prior to any of the code in my webpart actually executing. I have tried googling and just thinking through what this error might be referring to but can't come up with anything.
I never start debug in SP project not like in a Web one.
Rebuild your webpart project, check that you are configurates as
'Debug'.
Add your process (w3wp.exe) to debug (Ctrl+Alt+P). Or add to your
code where you would like to debug (I think this is same in VB
also):
System.Diagnostics.Debugger.Launch();

adl command line turned silent

I am starting to develop a new air/html/ajax application today and for some reason my trace() output is not being printed to the console window anymore. Plus, I am also not getting any error messages printed for syntax errors or runtime errors. I tried this on a different machine and there was no problem, so it must have been something wrong with this particular machine. I was thinking it had to do with me using the flex 3 sdk, but removing that from my path variable did not help, neither did reinstalling the air sdk. If anyone has encountered this before, help would be greatly appreciated.
This is not specific to the debugger player. The availability of trace statements in the console from ADL is dependent on whether or not any one of the following settings are turned on in your mm.cfg file:
ErrorReportingEnable
TraceOutputFileEnable
Either one of those will block trace output in the console window - stderr I believe - and instead (in the case of TraceOutputFileEnable) redirect it to a log file.
More information about mm.cfg is available here.
I figured it out. It is because I installed the flash debug player. Now the error messages all go the the log file where the debug player writes to.