Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
I am working with Visual Studio 2019 environment.
My objective is receive from 2 serial ports ,display and logged the data in binary file. i Have used timers to display or logged the data. Also have many classes in the code for conversions formula.
All is working well in IDE but data not display or logged in .exe file. I have tried everything but nothing works

What I have tried:

I have tried configuration Manager settings, threads implementations etc.
Posted
Updated 9-Mar-21 6:55am
Comments
CHill60 9-Mar-21 3:52am    
Given that we can't see your screen nor read your mind there is not a lot of information here for us to help you.
If a program runs in the IDE then it will run as a debug exe. Are you sure you are running it and not just compiling it?
Are you getting any compile warnings? If so, treat them like errors and fix them
Where are you running the .exe from? Is it expecting anything else in a specific folder that isn't there when you run it from outside the IDE? E.g. A config file or a database file.
Finally - what do you mean by "nothing works" - have you put any logging in place to see how far it gets? Are there any error messages shown? Have you examined the Event Logs on the PC?

We can't help you - we have no idea what your code is doing, let alone how it is doing it.

But ... the most common reasons for apps working in Development but failing in Production are:
1) Connection strings: Particularly if they are hard coded into an app, but even configured ones need testing and are prone to errors on release.
2) Permissions.

I'm guessing (from "in binary file") that your problem is likely the second.
The most common reason for permissions being a produtcion problem are that you store data in the EXE folder, which in dev is a bin folder under your project, and in production is under the "Program Files" or "Program Files (x86)" folder - which is write protected to help reduce virus activity.
If you don't specify a full path when you write to your files, it goes to the EXE folder, and that fails in production.
This may help: Where should I store my data?[^]
 
Share this answer
 
"Run in the IDE"? That's not a thing. There's no interpreted language here.

Your app, when "run in the IDE", is actually being compiled into an .EXE and executed. Once launched, the debugger is attached to the running process.

You're running an .EXE every single time you test your app.

And, as the others have said, there is no way to help you because you haven't shown any of your code, supplied no error messages, nor even described how your code is failing compared to what is expected.
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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