Application is compiled but does not run - wpf

I made some changes in a WPF xBap application and it compiles well but the new changes is not applied and when I put a break-point on the changed lines, the IDE ignores the break-point and shoes the following hint message: "The breakpoint will not currently be hit, No executable code associated with this line."
I tried the following:
Cleaned and Rebuilt the Solution
Cleaned the cache
Restart the machine
and no hope.
Any idea or suggestion will be appreciated.
Note: The application works well with the new changes in the published version but it does not through the IDE.

"No executable code associated with this line"
try to add a debug line Console.WriteLine() and add a break point at that line.

I found the problem, it's because a wrong path in the file projectName.csproj.user.
I opened the file using the notepad and edited it manually.

Related

How to fix function (that validates input) from not reading a text file? [duplicate]

Trying out the Clion EAP on the Mac. How does one change the current working directory for a launched program? It appears to be set to the output directory of the binaries.
This can be changed via the Run -> Edit Configurations... dialog, just like Idea.
The mix of needing to make changes to CMakeLists.txt for so much of the configuration just threw me, and I've been hunting for a way to change it there, but this bit at least is consistent with the other IDEs, which is good.
Hopefully they'll improve the rest of the Project Settings in a similar fashion.
The "Working Directory" is where the executable starts. Modifying the "Working Directory" in the Configurations setting tells Clion to change to the "Working Directory" after the executable starts execution.
If you want to change where the executable starts execution you will need to add a line to the CMakesLists.txt file.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(TimeServer ${SOURCE_FILES})
Position in the cmakes file is important. If you add the set command after the add_executable it will not work. It must come before.
These answers are relatively old. Not sure when the feature was added but there's a very nice UI way to set the current working directory now.
I made a YouTube tutorial for my COSC1030 (Beginning C++) students but the solution is the same for everyone:
https://youtu.be/dTtZEAfh_LM
If you know your CLion fairly well and don't need a demo, here's a short-hand version: Edit Configurations (from drop-down menu at top right of screen), enter the directory you want to use in Working Directory or select via "..." pop-up.

CodeBlocks not refreshing my program after modifying code

Thanks.
So when I write some code into codeblocks using c language and run it, granted the code is error free, it runs fine. Subsequent modifying and running of the code only produces the results of the first time I ran the code unless I delete the executable and object files. In other words it is not updating to the code that I modify. I am running the latest version of CodeBlocks. Is this a setting I need to change?
Update:
After reading the answers and comments below, I was able to correct the problem. As many suggested I indeed needed to click "build and run". I know it's such a basic question but I'm new to programming so thanks for your help. The confusion came when I would first click to "run" a code it would automatically ask me if I wanted to build it first. So I just thought every time I clicked "run" it would automatically build it first.
In Codeblocks, there should be a "Build and Run" button to fix your problem assuming that you were only pressing "run" before you read this
Build and Run Screenshot

Codeblocks not stopping at all breakpoints

I am attempting to build a custom lookup in exim, I have followed the docs and good the groundwork in place so my additional code is being compiled and hooked in, as well as being called. I am using the Makefile included with Exim to perform the build and I have added in CFLAGS=-g -O0 to ensure I have debugging symbols.
Codeblocks, gcc, gdb and the source all live on my Linux box, which I am SSHing into and exporting the X session to my Windows desktop using XMing, I don't think this has any baring on the problem, but worth mentioning.
Now, my problem is that when I run debugger with breakpoints in, C::B seems to be not setting or gdb is ignoring breakpoints in my code, but is hitting ones I have in the main function (I added one at exit so I could read the execution output and to prove they were working).
I have confirmed my code is actually being called, it currently spits out an error message, which it is doing. If I add a breakpoint on that line, it doesn't fire, nor if it's on the function or first line of the function.
What is even stranger (to me), is that previously it was working! it only stopped working when I resized the bottom C::B pane which caused a portion of the screen to not render (I think this is a problem with C::B and XMing, sometimes I just get a grey blank window and need to stop and restart C::B). So I quit C::B, restarted it, reloaded my project and since then break points in my code simply do not work, even though I can prove the code is being executed.
Also if I manually add the breakpoint it works as expected. I set a breakpoint in C::B at the start of main. Hit debug and then sent b mddfind_open (name of my function) into gdb and hit continue.. C::B stops again at the start of that function. Possibly some weirdness with how C::B is passing the breakpoints to gdb?
UPDATE:
The project I am working on is Exim, which links the code into the build directory (due to some bug with gcc 2.92.x and extern's IIRC). If I open the file from that location in C::B and set a breakpoint it works as expected. I suspect that C::B is possibly passing incorrect references to gdb?
Any ideas?
It would seem that in this situation I need to specify the source path for the source file in question, even though it is within the root source path.
Originally I had my GDB source path set to:
/home/graeme/exim/src
The code in question lives in src/lookups, so adding that path too fixes the problem
/home/graeme/exim/src
/home/graeme/exim/src/lookups
I believe this situation has arisen as the code I am building is initially compiled into a static library, this library is then linked into the main program itself. As such symbols reference the source for the library source files located at the point the library was compiled. So in this case there are multiple packages being built, and I needed to reference each of them in the source paths.

Anchor fails when executing .exe at a different path

I have a form with some controls that are positioned with the Anchor Property.
I Debug AND Release Mode it works fine, but when I copy the .exe to another place and execute it there it fails.
This only happens for this one special form, all other forms of the project work... I hope that someone ran into that earlier
EDIT: It's bad said: The anchor positioning does not work properly
I found it and I post it here in case someone else is also trapped by that:
Copy all resource dlls and everything else that is produced by the Compiler along with the .exe

OpenFileDialog crashes under Windows XP, but not Windows 7

I've got a strange problem I haven't seen before. I can open an OpenFileDialog in Windows 7 without any problems. However, when I try my app on Windows XP, calling OpenFileDialog.ShowDialog() immediately crashes the application. It just vanishes! When running from the debugger, I don't get any unhandled exceptions. If I wrap the code in a try/catch block, nothing gets caught. I have also checked all thrown exceptions in Debug -> Exceptions, but nothing pops up. I'll try some of the other suggestions in the answers below and will report back.
Does anyone know how to resolve this problem? I found a post about something similar, but it was the opposite problem. I'll try tweaking the desktop settings to see if it's related to that, but I am dubious.
EDIT -- as a sanity check, I wrote a test WPF application that displays an OpenFileDialog directly via the main window as well as another Window that can be displayed by the main window. It totally works fine under Windows XP. So now I'm really confused. I have verified that I'm not doing something stupid like trying to display the dialog from a worker thread. The OpenFileDialog displays briefly, then disappears along with the application.
EDIT -- I'm going to try to reproduce this problem on another XP computer. For now, I'll try Windows XP mode and we'll see what happens.
I got a similar error when a DLL crashes when I open a OpenFileDialog. It turned out that OpenFileDialog changed the working directory so my dll tried to write to a relative file that did not exist.
Do you see any "First Chance" exceptions in the Output? Any entries in the event log? Does the default path you're using exist on the XP machine?
Try adding a handler to the App Domain's UnhandledException
Does the same happen when you use a brand new, stock FileOpenDialog without any tweaks? What about from a brand new app which does nothing but show a file open dialog?
See Galet's post
I cannot tell you what exactly the problem is, but here's what you could do to get a clue what's really happening. I assume you're using VS2008 or 2005.
1.Switch to release mode
2.Go to Debug\Exceptions, and mark all "Thrown" exceptions, like illustrated here: http://vvcap.net/db/JbWS_tzy2IpBoI7R7amm.htp
3.Run executable in debugger, ignore the warnings from VS that there's no debug info
It does seem that there's a win32 exception thrown some time during execution, but this way or another, you will get one or more messages from debugger explaining what kind of exception happened and where. In most cases those messages make it pretty clear what exactly went wrong
EDIT: One thing I forgot to mention is that unmanaged debugging must also be turned on, such like here (when you start program directly from IDE) or here (when you attach to running process)
link|edit|flag edited Apr 12 '09 at 22:32
answered Apr 10 '09 at 19:01
galets
1,2201924

Resources